Hello,
We are creating a GUI in Matlab guide. The problem I have is that I am accesing the data from a structure within structure which has fields such as data and time (which I need). The code is written in such a way that the name of the paritucular loaded field is always in the path, how to avoid this?
Here is how I am accesing the data:
[filename,pathname]=uigetfile('*.mat') %,'Select One or More Files','MultiSelect', 'on')
MyData= load(filename);handles.MyData = MyData; MyData=handles.MyData;
But then I am eding up with this structure within structure with a code that only works for a specific filename:
time=MyData.Specificname.fieldA(1,1)
This is what I have tried without success:
% fn=char(fieldnames(MyData))
% s=sprintf('h.SD=MyData.%s',fn);
% eval(s);
% h.SD=fn
Thanks in advance!
Best Answer