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: While a cell in an array isn't zeros
Replies: 2   Last Post: Jan 27, 2012 11:29 AM

Advanced Search

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

Posts: 11
Registered: 11/18/11
Re: While a cell in an array isn't zeros
Posted: Jan 27, 2012 11:29 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I didn't completely understand the structure of your cells, but you could try with :
while sum(system{3,5}(:) == 0) < 3*n
% your code
end

or
while sum(system{3,5}(:) < 1e-10) < 3*n
% your code
end

Good luck!
Claudio

"Mohannad" wrote in message <jfs98r$r2a$1@newscl01ah.mathworks.com>...
> I'm very close to finishing this project and I just run into this one problem,
> I have an array of 3 rows and m columns called system. and m gets larger at each iteration of the code.
>
> I just need to know who can I specify in the while statement that I want the code to keep running as long as the the cell system{3,m} IS NOT all zeros? this cell is a n by 3 matrix representing forces.
> Or some small value such as 1e-10 might be more appropriate.
>
> Thank.




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.