Hello everyone, I have a code to call intensity values which are stored in a structure 's'. The structure 's' has various fields and the field(or variable, I'm not sure what it's called) signal2 has the values I need to access. When I use the following code for just one of the signal2 data's I get the desired output :
Code:
int_val= s.cellList.meshData{1,19}{1,1}.signal2;int_val(int_val>threshold)=1;int_val(int_val~=1)=0;
Output:
list of numbers in an excel sheet
({1,19} is a cell inside the field meshData containing the desired values).
However, when I try to create a loop to access each of the cells(1:25),
for j=1:25int_val= 's_',num2str(i),'.cellList.meshData{1,',num2str(j),'}{1,1}.signal2';%this ends up creating a character array.
int_val(int_val>threshold)=1;int_val(int_val~=1)=0;
How do I get the values from the structure?
Best Answer