How to find the scalar multiple of two vectors?
2 ビュー (過去 30 日間)
古いコメントを表示
Example; a=[1;2;3] and b=[2;4;6], hence the lambda is 2.
0 件のコメント
回答 (1 件)
James Tursa
2018 年 5 月 18 日
編集済み: James Tursa
2018 年 5 月 18 日
E.g., (with some accounting for potential 0 values)
d = b ./ a;
result = mean(d(~isnan(d)));
This is naive code that assumes the same scalar applies to all elements. If it is possible that is not the case, you would need to tell us how to handle the situation.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!