필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to ask the user to check avalue from a loop

조회 수: 1 (최근 30일)
Ahmed Alshehhi
Ahmed Alshehhi 2018년 3월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
I have this loop
For i= 1:30
s=a*x(i);
if s>=0
cc(i)=1;
else cc(i)=0;
end
end
I want the user to select a number between 1:30 and check if it is equal to 1 or 0 and state that for 0 it is normal and for 1 it is not
  댓글 수: 2
Guillaume
Guillaume 2018년 3월 16일
I want ...
While I understand what you ask I completely fail to see how it relates to your loop. What is the link?
Ahmed Alshehhi
Ahmed Alshehhi 2018년 3월 16일
I may not explain my equation corectly . I dont know how to let the user to enter a number and check it base on the loop result

답변 (1개)

David Fletcher
David Fletcher 2018년 3월 16일
편집: David Fletcher 2018년 3월 16일
I'm not entirely sure I understand what you are trying to do, but if you just want to get basic input from the user then see the docs on the input function.

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

Community Treasure Hunt

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

Start Hunting!

Translated by