Error using size and Error in cross

조회 수: 4 (최근 30일)
Jenice Chen
Jenice Chen 2018년 12월 26일
다시 열림: Walter Roberson 2019년 1월 15일
if isvector(a) && isvector(b)
if (nargin == 2 && (length(a) ~= 3 || length(b) ~= 3)) || ...
(nargin == 3 && (size(a,dim)~=3 || size(b,dim)~=3))
error(message('MATLAB:cross:InvalidDimAorBForCrossProd'))
end
Error using size
Dimension argument must be a positive integer scalar within indexing range.
Error in cross (line 24)
(nargin == 3 && (size(a,dim)~=3 || size(b,dim)~=3))
  댓글 수: 1
madhan ravi
madhan ravi 2018년 12월 26일
Sorry Jenice , I believe you are not allowed to post the file which is copyright by Mathworks in a public forum like this.

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

답변 (2개)

madhan ravi
madhan ravi 2018년 12월 26일

Walter Roberson
Walter Roberson 2018년 12월 26일
do not pass 3 or more arguments to cross unless you are deliberately telling it which dimension to process .
you were passing 4 arguments in before and that is not defined at all.
If you need to take A cross B cross C then you will need to make multiple calls to cross.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by