Load data file and compare data

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 Commento

Sai - please clarify what you need help with. Have you created the GUI (using GUIDE or App Designer)? Or comparing the data?

Accedi per commentare.

Risposte (1)

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.

Categorie

Scopri di più su Interactive Control and Callbacks in Centro assistenza e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by