How to pass message box value to the text box?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sam Upeshala
el 12 de Dic. de 2018
Comentada: Adam Danz
el 12 de Dic. de 2018
In my matlab application it run a .m file using matlab gui. that application gives the ouput in messagebox as "belongs to class 1,..". I want to pass this value to a text box in matlab gui. Please can you explain how can I do it?
0 comentarios
Respuesta aceptada
Adam Danz
el 12 de Dic. de 2018
If I understand you correctly, you want to extract the text from a message box and copy it to a text box in your GUI.
Step 1: Copy the message box string.
mh = msgbox('Copy this text.'); %Create a message box
th = findall(mh, 'Type', 'Text'); %Get the handle to the text within the box
msgString = th.String{:}; %Copy the string
Step 2: put the string in your your text box
The handle to you text box in this example is h.text1.
h.text1.String = msgString;
2 comentarios
Sam Upeshala
el 12 de Dic. de 2018
Editada: Sam Upeshala
el 12 de Dic. de 2018
Adam Danz
el 12 de Dic. de 2018
To use my method, you need the handles to your message box.
mh = msgbox(strcat('detected class',num2str(det_class)));
mh = msgbox('Not Exist');
Then follow my example.
Más respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!