I like to know how many elements of one-row matrix.///
EX: V = [ 2 3 4 8 6 4 7 9 ], the answer is 8 wich the number of elements in one row.////
Thank you

 채택된 답변

Walter Roberson
Walter Roberson 2017년 5월 14일

1 개 추천

size(V,2)
is specifically the number of columns in V, even if V is multi-dimensional.
In the case where you know V is a vector, then length(V) can be used, provided that you want a column vector with 8 elements to return the same as a row vector with 8 elements would.

댓글 수: 1

fathi
fathi 2017년 5월 14일
Thank you Walter Roberson , this is what i want.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

질문:

2017년 5월 14일

댓글:

2017년 5월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by