how to divide 2 array

1 回表示 (過去 30 日間)
Sourav singh
Sourav singh 2021 年 3 月 15 日
回答済み: obfish 2021 年 3 月 15 日
U = [0 10 15 20 25 30 35 40 ];
P = [32.91428 30.8628 26.5554 23.45806 22.92738 24.98139 29.61881 36.97433 47.28429];
U_by_p= U/P; % i am writing this in script

採用された回答

obfish
obfish 2021 年 3 月 15 日
Just use dot-divide for element-wise operation.
U_by_p= U ./ P;
By the way, your vector has incompatible size, you should fix this first.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by