Help projecting a vector onto another!

155 次查看(过去 30 天)
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