I'm trying hard to obtain values from a structure, defining the fields as strings, but I can´t do it.
It always returns the error:
Argument to dynamic structure reference must evaluate to a valid field name.
The piece of code I'm using looks like:
S = load('ResLongspcSt.mat');
j = fieldnames(S);
x = length(j);
for i = 1:x
x2(i) = S.([j(i)])(500,i);
end
Thank you very much for your advice!