How to substract one number from many numbers?

4 ビュー (過去 30 日間)
Azad Khandoker
Azad Khandoker 2019 年 7 月 29 日
編集済み: madhan ravi 2019 年 7 月 29 日
I would like to solve
W = x - 0.6 ( Where x=0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20, 1.25, 1.30, 1.35, 1.40, 1.45, 1.50, 1.55, 1.60, 1.65, 1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40, 2.45, 2.50)
I would like to minus/substract each element of x from 0.6
Please suggest.....
Thanks in advance.

採用された回答

Jim Riggs
Jim Riggs 2019 年 7 月 29 日
編集済み: Jim Riggs 2019 年 7 月 29 日
W = x - 0.6
Or, if you want to actualy subtract x from 0.6 it would be:
W = -x + 0.6
  5 件のコメント
Azad Khandoker
Azad Khandoker 2019 年 7 月 29 日
編集済み: Azad Khandoker 2019 年 7 月 29 日
Thank you...now it works...
One more thing to learn....
If I want to take only the positive values of 'W' and want to consider all the negative (-) values of 'W' as zero (0), How to write the code?
madhan ravi
madhan ravi 2019 年 7 月 29 日
編集済み: madhan ravi 2019 年 7 月 29 日
Azad may we know what you were trying when it didn’t work??? Also are you trying to get your homework done one by one?
If so https://in.mathworks.com/help/matlab/getting-started-with-matlab.html - have a read , would be helpful for you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by