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일

0 개 추천

x = linspace(0.1,1,17).';
y = x;
y(y>0.5) = 1;

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

질문:

2023년 7월 3일

댓글:

2023년 7월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by