if command with @(x,t) equation
이전 댓글 표시
I want to always display error but not when error only equal zero; so far, this is what I got, but it only works when error only equal zero. thks for your help


댓글 수: 7
madhan ravi
2018년 12월 6일
편집: madhan ravi
2018년 12월 6일
upload the full code
Well, clearly your elseif statement has a couple of problems:
Firstly the first part of it is identical to the if statement so would never get hit anyway because your code would always land in the if statement.
Then, in the same vein, the thing you and it with is its exact inverse so that statement would always evaluate to false, just like if you had the statement:
if true & false
madhan ravi
2018년 12월 6일
편집: madhan ravi
2018년 12월 6일
in addition to that you can't compare a function handle ! unless it's evaluated
May97
2018년 12월 6일
'Only if' is just an if statement, e.g.
if x == 0
disp( 'x is 0'
end
May97
2018년 12월 6일
답변 (1개)
Torsten
2018년 12월 6일
1 개 추천
https://stackoverflow.com/questions/18183648/matlab-check-if-function-handle-is-a-particular-function-or-function-type
댓글 수: 1
madhan ravi
2018년 12월 6일
+1 Torsten you are absolut!
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!