Help projecting a vector onto another!

조회 수: 338 (최근 30일)
Viet
Viet 2016년 5월 24일
답변: Roger Stafford 2016년 5월 25일
Write a Matlab function projectUV(), that is, function [w] = projectUV(u,v) which computes a projection vector of u on v thus performing the operation projv = u v u v v Test the function by computing the projection of vector u = (1, 2, 3) onto v = (1, 1, 0).

답변 (2개)

Roger Stafford
Roger Stafford 2016년 5월 25일
dot(u,v)/dot(v,v)*v;

Todd Leonhardt
Todd Leonhardt 2016년 5월 25일

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by