This might be modified to do something useful. Not sure I understand the
problem.
call it with
structprint(s)
and get
[data]
[w1]
s = 237.60
[w2]
s = 44.200
[w3]
s = 150
[w4]
s = 3000
[r1]
s = 14.500
[r2]
s = 14.500
-----------------------------
function structprint (s,depth)
if 1==nargin
depth=0;
end
if isstruct(s)
fnames=fieldnames(s);
for i=1:length(fnames)
printf("%s[%s]\n",repmat(' ',1,depth*2),fnames{i});
structprint(getfield(s,fnames{i}),depth+1);
end
else
printf("%s",repmat(' ',1,depth*2));
s
end
end
-----------------------------