Display the result of m file in app designer

4 views (last 30 days)
Ayman Shaban
Ayman Shaban on 22 Mar 2022
Commented: Rik on 25 Mar 2022
Hi, I'm working on code for speech recognition, I finished it and I start making GUI using app designer, I succeeded in take the audio from user and run the code by push button, but i don't know how i get the result in an edit field in my app.
thank you.
  8 Comments
Ayman Shaban
Ayman Shaban on 24 Mar 2022
prediction = trainedClassifier.predictFcn(features);
if prediction == 0
result = 'This case is healthy'
disp('This case is healthy');
elseif prediction == 1
result = 'This case is patient1'
disp('This case is patient1');
elseif prediction == 2
result = 'This case is patient2'
disp('This case is patient2')
elseif prediction == 3
result = 'This case is patient3'
disp('This case is patient3')
else
result = 'This case is patient4'
disp('This case is patient4')
end
like that ?
Rik
Rik on 25 Mar 2022
No. Remove the lines with disp and add something like this after this code:
set(app.edit1,'String',result)

Sign in to comment.

Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!