Error using size and Error in cross

4 vues (au cours des 30 derniers jours)
Jenice Chen
Jenice Chen le 26 Déc 2018
Rouvert : Walter Roberson le 15 Jan 2019
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 commentaire
madhan ravi
madhan ravi le 26 Déc 2018
Sorry Jenice , I believe you are not allowed to post the file which is copyright by Mathworks in a public forum like this.

Connectez-vous pour commenter.

Réponses (2)

madhan ravi
madhan ravi le 26 Déc 2018

Walter Roberson
Walter Roberson le 26 Déc 2018
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.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by