2 views (last 30 days)

How do i write a code which can calculate the cross production of two vector ? Both of these two vectors are 1 by 5 vector

At first, i write the code like

a=randn(1,5);

b=randn(1,5);

cross_c=cross(a,b)

or

a=randn(1,5);

b=randn(1,5);

cross_c=cross(a,b,5)

But the window always show me

A and B must be of length 3 in the

dimension in which the cross

product is taken.

How do i write a code which can calculate the cross production of these two 1 by 5 vectors?

Bruno Luong
on 24 Sep 2019

Edited: Bruno Luong
on 24 Sep 2019

If A and B are 5 x 1

null([a;b])

returns a (5 x 3), 3 vectors in R^5 basis of NULL(SPAN(a,b))

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 2 Comments

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481793-how-do-i-write-a-code-which-can-calculate-the-cross-production-of-two-vectors#comment_749241

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481793-how-do-i-write-a-code-which-can-calculate-the-cross-production-of-two-vectors#comment_749241

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481793-how-do-i-write-a-code-which-can-calculate-the-cross-production-of-two-vectors#comment_749253

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/481793-how-do-i-write-a-code-which-can-calculate-the-cross-production-of-two-vectors#comment_749253

Sign in to comment.