subtract two matrices of sizes [1*5] and [3*5]

1 回表示 (過去 30 日間)
NN
NN 2020 年 12 月 17 日
回答済み: Daniel Pollard 2020 年 12 月 17 日
I need to subtract m from y ,
m= [1 2 3 4 5 ]
y=[ 10 11 12 13 14
9 8 7 6 5
15 16 17 18 19 ]
Please help

回答 (1 件)

Daniel Pollard
Daniel Pollard 2020 年 12 月 17 日
Well I typed
m = [1 2 3 4 5];
y = [10 11 12 13 14; 9 8 7 6 5; 15 16 17 18 19];
y-m
into my matlab command window, and it returned
[9 9 9 9 9;
8 6 4 2 0;
14 14 14 14 14].
What's the problem exactly?

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by