I have a bunch of variables called length_act_i
where
i=1:6
I'd like to call each one sequentially as part of a for loop, but this doesn't work:
for i=1:6
I={['length_act_',num2str(i)]};
subplot(3,2,i)
[f x]=hist(I,1:2:5);
bar(x,f./trapz(x,f),'barwidth',0.5,'r');
end
What's the most efficient way to do this?
Regards,