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: double for loop
Replies: 5   Last Post: Sep 9, 2013 10:29 AM

Advanced Search

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

Posts: 8,290
Registered: 6/7/07
Re: double for loop
Posted: Sep 9, 2013 8:58 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 9/9/2013 6:28 AM, cwc wrote:
...
>> > Can someone explain to me the mechanics for a double for loop?
>> >
>> > [x,y] = size(z)
>> > for ii = 1:x;
>> > for jj = 1:y;
>> > newz = z(ii,jj)
>> > end
>> > end
>> >

...

> I can't seem to understand how the new matrix can become twice the size.

W/ the above code it can't.

And, in fact, in the above code newz will end up being a single value
since you didn't subscript it the assignment will overwrite the variable
each pass.

--





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.