Hi,(adsbygoogle = window.adsbygoogle || []).push({});

I am am trying to determine the number of rows in a matrix using matlab,

I usually use

>>[rows,cols]=size(X);

>>rows

but this requires me to do the operation in 2 steps which will not work in my application.

I need to be able to determine the number of rows in one step so I can use it as a parameter in a 'while' loop.

I have tried using rows(X), but I get an error message. I haven't been able to find a solution and my code has come to a stand still. Surely there has to be a function or easy way to do this?

Thanks

Elbarto

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Count rows in Matlab

Loading...

Similar Threads for Count rows Matlab | Date |
---|---|

Count from MatrixForm in mathematica | Sep 25, 2012 |

Mathematica Calculating length from pixel count | May 11, 2012 |

Defining a counting function in mathematica | Aug 10, 2011 |

Counting Occurrences in a 2D Array with MATLAB | Jul 2, 2011 |

Counting the number of rows/cols in a matrix with Matlab | Feb 26, 2010 |

**Physics Forums - The Fusion of Science and Community**