I want to multiply 2 arrays
2 ビュー (過去 30 日間)
古いコメントを表示
A=
[4951;
5782;
9553;10384]
B=[2;2.5;2.8;3]
C=A.*B or bsxfun(@times,A,B)
the result is
1.0e+04 *
0.9902
1.4455
2.6748
3.1152
why is this so?
0 件のコメント
回答 (2 件)
John D'Errico
2016 年 12 月 14 日
編集済み: John D'Errico
2016 年 12 月 14 日
Oh. That is not the product of those numbers? Seems right to me, as long as you don't miss that factor of 1e4 out front.
What did you expect?
doc format
David Barry
2016 年 12 月 14 日
I don't see the problem. What are you expecting the answer to be?
- 4951 * 2 = 9902
- 5782 * 2.5 = 14455
- etc...
2 件のコメント
David Barry
2016 年 12 月 14 日
MATLAB has given you the exact values. Do you not understand scientific notation? I suggest you Google it if not. What exactly do you mean by "correct decimal place".
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!