Info
This question is closed. Reopen it to edit or answer.
How can I get the table of values contained in a struct from my workspace by the user input in dialog box.
1 view (last 30 days)
Show older comments
Each struct(Data Item Name) in my workspace contains a table. The path to obtain that table in a specified struct goes like this : Power_DriveShaft_HP.signals.values.
- - Power_DriveShaft_HP : being the main struct in the workspace
- - Signals : is an other struct whithin the first struct.
- - Values : is the table in the signals struct that I want to extract.
Typing this in the command window would get me the table I am looking for. But when I want to assign that table to a variable in my main program it doesn't work.
Here is my code where I ask the user which struct he wants to get the data from.
prompt = {'Entrez le nom du ''''Data Item Name'''' contenant les données d''accélération en X dans ATI VISON'};
dlg_title = 'Configuration de la FFT';
num_lines = 1;
def = {''};
answer = inputdlg(prompt,dlg_title,num_lines,def);
data_item_name = answer{1,1};
data_item_name will then take the value 'Power_DriveShaft_HP' but writting in the command window : data_item_name.signals.values is giving me the error : Attempt to reference field of non-structure array.
I hope I explained right. Ha someone ever tried something like this ?
Thanks
0 Comments
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!