Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

size(m,2) how the function works?

조회 수: 2 (최근 30일)
Shaila parvin
Shaila parvin 2013년 6월 29일
m=[1,2,3; 4 4 4; 3 3 1];
n=size(m,2);
answer: n=2
I don't understand how this function calculates the answer. Please help me.
  댓글 수: 1
Wayne King
Wayne King 2013년 6월 29일
So this post was a mistake? You did not get an answer of 2 as you report? Then perhaps we should just delete this post?

답변 (1개)

Wayne King
Wayne King 2013년 6월 29일
편집: Wayne King 2013년 6월 29일
m=[1,2,3; 4 4 4; 3 3 1];
n = size(m,2);
returns n = 3
I suspect that you have a different function called size() that precedes the MathWorks' version on your path. Or maybe you have a variable called size() in your program or command window. Both of these possibilities are very bad ideas
If you enter:
>>which size
what do you get. If it says "is a variable", then remove that variable. If you get a path other than something like
matlab\toolbox\matlab\elmat\size
Then remove the other function, or move it to a folder not on the MATLAB path.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by