MATLAB Answers

How can I find an orthogonal vector?

조회 수: 30(최근 30일)
Sue Swenson
Sue Swenson 2021년 5월 2일
편집: David Goodmanson 2021년 5월 2일
This seems like it should be simple, but I haven't been able to figure out how to use Matlab to calculate an orthogonal vector.
If my vector is:
syms a
p=[1;-a;0]
Then dot(p, the_orthogonal_vector) should = 0. But how can I calculate the orthogonal vector? I tried
help null
but couldn't see how to apply that to this.

채택된 답변

David Goodmanson
David Goodmanson 2021년 5월 2일
편집: David Goodmanson 2021년 5월 2일
Hello Sue,
use null of the transpose of p:
syms a
p=[1;-a;0]
n = null(p.')
n =
[ a, 0]
[ 1, 0]
[ 0, 1]
and each column of n is perpendicular to p, as is any linear combination of those two columns.

추가 답변(0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by