It shows Error in my GUI...
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Walter Roberson
am 21 Feb. 2013
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 Kommentare
Image Analyst
am 23 Feb. 2013
Bearbeitet: Image Analyst
am 23 Feb. 2013
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);
Siehe auch
Kategorien
Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!