when i want to get magnitude of vector in command window told me that index exceeds matrix dimensions. although i write true code
2 ビュー (過去 30 日間)
古いコメントを表示
v=[1 2 3 9 6]
pp=v.^2
Rr=sum(pp)
mag=sqrt(Rr)
disp(mag)
回答 (1 件)
Paul
2024 年 5 月 11 日
Code works here
v=[1 2 3 9 6]
pp=v.^2
Rr=sum(pp)
mag=sqrt(Rr)
disp(mag)
Check
norm(v)
Perhaps you have variable(s) named sum or sqrt or disp in your workspace?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!