Scalar multiplication of a vector
4 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I want to write a program using as little for-loops as possible. I want to define the following multiplication:
[a b] * [x1 y1; x2, y2; x3 y3] = [a*x1 b*y1; a*x1 b*y1; a*x1 b*y1]
Can i do this without the use of for-loops?
0 件のコメント
採用された回答
Andrei Bobrov
2014 年 3 月 18 日
編集済み: Andrei Bobrov
2014 年 3 月 18 日
bsxfun(@times,[a b],[x1 y1; x2, y2; x3 y3])
here a, b, x1, y1, x2, y2,x3, y3 - numeric
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!