フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to display nothing on textbox after pressing pushbutton if no image is loaded on axes ? GUI

3 ビュー (過去 30 日間)
Satyabrata Nath
Satyabrata Nath 2017 年 4 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am doing a project on image classification in which there are 2 pushbuttons(one for loading images in axes and another for classifying that image and produce output on textbox),1 axes and 1 statictext box .The problem that i am facing is that even if i dont upload an image in axes and press the classify button , it still gives an output in textbox.So how to set a condition that if an image is not uploaded then the textbox remains blank after pressing the classify button.
pred_th=max(b);
F = get(handles.axes1);
if isempty(F)
set(handles.text3,'String','')
else if(pred_th >=3.2)
accuracy = mean(diag(confMat))
textLabel1=sprintf('%s (accuaracy = %f) ',predictedLabels1,accuracy);
set(handles.text3,'string',textLabel1)
else
textLabel2=sprintf('image dont match');
set(handles.text3,'string',textLabel2)
end
end

回答 (1 件)

Santhana Raj
Santhana Raj 2017 年 4 月 25 日
Two options:
One you can disable the classification button, until the image is loaded. Make is disabled by default and then enable it after you load the image.
Two, Set a flag variable when you load an image. Check for the flag before starting your classification when the button is pressed. That way you can make it display that image is not loaded.
Hope it helps
  1 件のコメント
Satyabrata Nath
Satyabrata Nath 2017 年 4 月 25 日
Thanks . If you could provide any of the suggestions with a code , it will be a great help.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by