I'm quite new to matlab and just need to change a very small thing in a code. I have the following matrix:
ans =
1 1 1
1 2 1
2 1 1
2 2 2
how to get the count of rows of this ans? it should be 4
You should use the size function:
nRows = size(myMatrix, 1); % 1 stands for the first dimension
Just use the size function
size(ans, 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With