It shows Error in my GUI...
조회 수: 1 (최근 30일)
이전 댓글 표시
Error= num2str(err)
if Error(1) > 0.10000
L = 'Fail.';
set(handles.text15,'string',L);
else
L = 'Pass';
set(handles.text15,'string',L);
end
This is my program -
First In command window i am getting this answer in two lines and i want to use second, but every time it will not give two answers, but whatever the number is, i want to use last,
Error =
0.091683 0.085897
But in GUI it always shows Fail.. Why..?
댓글 수: 0
답변 (1개)
Walter Roberson
2013년 2월 21일
You are converting "err" to a string, and then comparing the string to the numeric value 0.10000. Why are you not comparing err instead of Error?
댓글 수: 3
Image Analyst
2013년 2월 23일
편집: Image Analyst
2013년 2월 23일
That doesn't make sense. What Walter asked is why you don't simply do this:
if err(2) > 0.10000
L = 'Failed';
else
L = 'Passed';
end
set(handles.text15,'string',L);
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!