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 Comment

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

Sign in to comment.

Answers (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.

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Asked:

on 25 Jul 2016

Answered:

on 1 Aug 2016

Community Treasure Hunt

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

Start Hunting!