I am programming a simple GUI which has to do 2 tasks:
1- import a set of data for a txt file
2- make some computation with the previously imported data
Both tasks are performed pressing a button, one button for each task.
For the "Load data" button (task 1) I used the uiimport command in the Callback of that button (as explained here Matlab Calling 'Import Data' with GUI Button):
S = uiimport('-file');
The data are loaded as a "191384x3 double". I also modified the function as follow, in order to have S available for the 2nd button:
function S = load_data_Callback(hObject, eventdata, handles)
Then I press the second button to perform the 2nd task. In the Callback of the 2nd button I wrote
function pushbutton2_Callback(hObject, eventdata, handles, S)
loaded_data = S; % to access the data in the non structured array
% Then I want to have 3 separate vectors out of the structure
v1 = loaded_data(:,1);
v2 = loaded_data(:,2);
v3 = loaded_data(:,3);
When I press the 2nd button I get an error message:
Not enough input arguments.
loaded_data = S;
Error in gui_mainfcn (line 95)
feval(varargin{:});
What am I missing?