GUI read and write data from workspace

4 visualizaciones (últimos 30 días)
Dharmesh Nadhe
Dharmesh Nadhe el 31 de Mzo. de 2011
Hello all, I am creating a GUI application for my function: [a_rms,a_w_t,a_w_f,freq] = acc_eight(acc,time,inter,'W'); here a_rms,a_w_t,a_w_f and freq are outputs and acc,time,inter and W (string) are inputs. Input variable "acc" and "time" are vectors with ard 100000 elements and I wish to read these vectors from workspace.I use two edit texts to read input "inter" and "W". I have a slide box and import button which imports data and then I see names of all variables in my slide box. After this I select input "acc" and "time" from the list. To execute my function and calculate on the basis on all workspace and other input I am using"evalin" function as:[acc_w_t,acc_w_f,frequency]=evalin('base',['acc_weight(',acc,',',time,',',inter,',',W,')']); But It reads acc and time from workspace but doesn't read inter and W which are given by user in edit text. Am I using evalin correctly? And how can I transfer back outputs of my function to workspace?

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 31 de Mzo. de 2011
If inter and W are obtained from an edit box, why do you attempt to evaluate them in the base workspace? You would use something like:
inter = str2double(get(hInterEditBox,'string'));
To assign values from your function in the base workspace, you can use assignin.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by