Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

calling a matrix

0 views
Skip to first unread message

Alan

unread,
Nov 30, 2009, 11:32:18 PM11/30/09
to
Hey all,

I'm creating a loop where p=[100 200 300] and i will load .mat file which contains a matrix. so the file will be something like something_100 for the first file, something_200 for the 2nd and something_300 for the third when it loops. but i can't seem to call the matrices which they respectively contain, ie abc_100 in something_100, abc_200 in something_200 and abc_300 in something_300. so my main question is, with 'abc_', how do you add the varying p values when looping to call for the matrix?

Thanks in advance!

James Tursa

unread,
Dec 1, 2009, 12:47:19 AM12/1/09
to
"Alan " <ghastly...@yahoo.com.sg> wrote in message <hf268i$361$1...@fred.mathworks.com>...

> Hey all,
>
> I'm creating a loop where p=[100 200 300] and i will load .mat file which contains a matrix. so the file will be something like something_100 for the first file, something_200 for the 2nd and something_300 for the third when it loops. but i can't seem to call the matrices which they respectively contain, ie abc_100 in something_100, abc_200 in something_200 and abc_300 in something_300. so my main question is, with 'abc_', how do you add the varying p values when looping to call for the matrix?
>
> Thanks in advance!

eval(['abc_' num2str(p(k))])

where k is the loop iteration index

James Tursa

0 new messages