Load data file and compare data
Afficher commentaires plus anciens
I am trying to make a GUI in which I want to give a toggle button (name 'Load'), which will load the data. Then a function having baseline measurement will be called to compare the result (result which is obtained from load is compared to baseline result). How can I do this?
1 commentaire
Geoff Hayes
le 1 Août 2016
Sai - please clarify what you need help with. Have you created the GUI (using GUIDE or App Designer)? Or comparing the data?
Réponses (1)
Joseph Moraal
le 1 Août 2016
Assuming that your question is pertaining to how to create the button click behavior you can do the following.
You can specify a callback to execute when clicking a button by using the "Callback" name-value pair argument in the "uicontrol" command. For example, the following code creates a button which opens a message box that says "Boo!" when you click on it:
>> fh = figure;
>> btn = uicontrol('Style', 'pushbutton', 'String', 'Click me!', 'Callback', @(~, ~) msgbox('Boo!'));
Refer to the following documentation page for more information on the "uicontrol" command:
In your callback you could use one of MATLAB's commands such as "dlmread", "csvread", etc to load your data. At that point you should be able to perform any data processing necessary for your app.
Catégories
En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!