help for project please

hello guys, i'm new to matlab and i want to know how to create a Vector that gives a 1 for values between 1 and 10 and 0 otherwise, thank you in advance

답변 (1개)

David Hill
David Hill 2020년 5월 4일

0 개 추천

y=(x>=1&x<=10);%will provide logical vector where x is your input vector

댓글 수: 2

ghaddar karim
ghaddar karim 2020년 5월 4일
but how can i specify the values of x because i don't have a given that tell me in which range it is
and thank you for the help
What is your input? You could create an input vector.
x=randi(50,1,1000);

이 질문은 마감되었습니다.

태그

질문:

2020년 5월 4일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by