Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

help:how to check whether a matrix is empty or not

Status
Not open for further replies.

austinpowers

Electrical
Oct 21, 2005
25
suppose i have a while in my program and i want that to run till an one dimensional array q is empty

how to use this condition
 
Replies continue below

Recommended for you

From your question it sounds like you are probably doing something fairly simple in a very inefficient manner. However,

help isempty
 
how is that inefficient ,

its an algorithm where i have to run a while loop till an array is not empty

and i found this isempty already before u replied,

but u r really helpfull replying to all of my messages

thanks a lot for that
 
how is that inefficient

The word "loop" normally means that whatever it is you are doing, you are not making use of Matlab's fantastic vectorization capabilities. In general, loops work well for small datasets, but don't scale well. Similarly growing and shrinking matrices. And from your lmited problem description, it sounds like are combining the two.

I didn't mean to offend. Sorry if I inadvertently have.

 
What you do mean by "empty?"

Are you zeroing the values in the array as you process?

If so, why aren't you using a FOR loop?



TTFN



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor