MATLAB Answers

How do i produce a warning and an error for the user

조회 수: 1(최근 30일)
Jose Grimaldo
Jose Grimaldo 20 Sep 2019
Answered: thoughtGarden 20 Sep 2019
The task is to promt the user to enter an input between 0 and 200.I have to produce a warning and take the asbolute value. If the absolute value is greater than 200 I have to produce an error and terminate the program. This is what i have so far.

  댓글 수: 0

로그인 to comment.

답변 수 (1)

thoughtGarden
thoughtGarden 20 Sep 2019
The task is to... sounds like homework!
I'll provide some food for thought
  • You currently only check for absolute values if the value is negative, but what would happen if a positive value was above 200? (hint: you should likely use an additional non-nested if statement to check the second condition)
  • Your use of warning and error are correct

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by