Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How can I specify counters for matrices?
Replies: 1   Last Post: Dec 7, 2012 11:26 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 2,006
Registered: 12/6/04
Re: How can I specify counters for matrices?
Posted: Dec 7, 2012 11:26 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.