I am trying to use a gui to go through some data and analyze segments of them.
I am able to select different segments using a spinner which value is then used to "cut" segments from my data: if spinner value =1 then take the first 100 points, if equals 2 the second 100, etc. each segment is one minute.
at the end of each minute analysis, I made a save button which is suppose to store some data back in the workspace as variables. In addition to that (which I have not yet implemented), I would like this button to calculate how much of my analysis is left by taking the spinner value, store it somewhere and - based on the total amount of segments set in a text box somewhere else - it should give out a % of progress onto a "gauge bar". I have already tried to create a "storing" variable in the app but it does not work: there is no place where I could initialize the variable (creating an empty array for instance) to which then I could append values... so I thought maybe I could use the work space for this and append spinner values to a "storing variable" and then read the storing variable to calculate a progress percentage. however it seems I can 't really create new vars in the workspace (I know the assignin function but somehow I get an error when I tried to create a new var from the app).
this is my code
function savedataButtonPushed(app, event)
value = app.selectminuteSpinner.Value;
REC = app.RECdurationminTextArea.Value;
completion = (str2double(value)/str2double(REC))*100;
app.Gauge.Value = str2double(completion);