Data loading in MATLAB
1 view (last 30 days)
Show older comments
Fedor Durnev
on 4 Feb 2020
Commented: Fedor Durnev
on 5 Feb 2020
Hello, I have some issues with data loading.
I have created a figure with some pushbuttons and axes.
Is it possible to load some data for plot building not simply using Y=load('my data.dat') in code?
I mean is it possible to make a button with a function which can open a window where I can choose any file which I want to load? (hope you understand what I am talking about)
Or perhaps, is it possible to make uicontrol where I can put file name and then push the button to load this data and make a plot? I tried to make something following this idea, but failed.
Thank you for help!
0 Comments
Accepted Answer
Benjamin Großmann
on 4 Feb 2020
Hi,
have a look at uigetfile and uiopen which open a file selection dialog box. This should solve your issues.
Regards,
Benni
More Answers (1)
Steven Lord
on 4 Feb 2020
Loading the data could be as simple as calling load. The more challenging part is likely to be sharing this data among the various components of your UI. If you're using App Designer, see this documentation page for a description of how to share data between component callbacks. If you're using GUIDE or creating the UI programmatically, see this page instead.
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!