How to project given vectors in matlab
조회 수: 9 (최근 30일)
이전 댓글 표시
v1 = [1.12;2.10;7.03;4.15;6.13] v2 = [1;-1.01;1.02;-1.03;1.04]
I need to calculate projection of v1 onto v2 how would I code this into matlab?
댓글 수: 1
John D'Errico
2017년 7월 1일
편집: John D'Errico
2017년 7월 1일
A dot product.
https://math.oregonstate.edu/home/programs/undergrad/CalculusQuestStudyGuides/vcalc/dotprod/dotprod.html
help dot
You will need the norm of the vector v1.
help norm
답변 (1개)
James Tursa
2017년 7월 1일
편집: James Tursa
2017년 7월 1일
E.g., see this link
https://en.wikipedia.org/wiki/Vector_projection
u = v2/norm(v2);
result = dot(v1,u)*u;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Software Development Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!