Making a new column from old column

2 ビュー (過去 30 日間)
Sia Sharma
Sia Sharma 2023 年 7 月 3 日
コメント済み: Sia Sharma 2023 年 7 月 3 日
Hi,
I have a variable which is a column (double) of 17 numbers from 0.1-1.0. I want to create a new variable which matches the old column however if the number on the old column is above 0.5, it will replace it in the new column with 1.0. How do I do this, please help!
Thank you!

採用された回答

Torsten
Torsten 2023 年 7 月 3 日
移動済み: Torsten 2023 年 7 月 3 日
x = linspace(0.1,1,17).';
y = x;
y(y>0.5) = 1;
  1 件のコメント
Sia Sharma
Sia Sharma 2023 年 7 月 3 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by