Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Curious
Posts:
2,358
Registered:
12/6/04


Re: How can I specify counters for matrices?
Posted:
Dec 7, 2012 11:26 AM


"panagiotis " <pkoniavitis@yahoo.com> wrote in message <k9t1f8$50g$1@newscl01ah.mathworks.com>... > Hallo. > > I want to give counters for matrices. I tried things like > > for i=1:3 > matr 'num2str(i)' =zeros(6,6); > end > > but did not work. > Let's say i want to create 3 matrices matr1 , matr2 & matr3 all 6x6 points. > > If anyone knows or has an idea , is welcome. > > Panagiotis
DON'T DO THIS!!!
See Q3.6 of the MATLAB FAQ at:
http://matlab.wikia.com/wiki/FAQ
for reasons why this is a VERY bad idea and alternatives (and how to do it if you REALLY must). The bottom line is to use cell arrays.
Specificaly, see
http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F



