How can I use fprintf to display a message in a text box in a GUIDE GUI?
12 views (last 30 days)
Show older comments
Hello, Im trying to build a results box into my gui.
Why will this code not display ‘Member F1 has not failed, with a final load of “value from the defined matrix” Newtons'?
% The results textbox must show the results for F1
message = fprintf('Member F1 has not failed, with a final load of %5.2f Newtons \n' , handles.matrix_X(1,end));
set(handles.results, 'string', 'message');
All that the text box displays is ‘message’. Please note that there is no line break in the 'message =' code, that is just the way it has copied and pasted.
0 Comments
Accepted Answer
More Answers (1)
dpb
on 23 Mar 2015
See
doc fprintf
for the "why". What does it say fprintf returns if there is an output variable given? (HINT: it isn't the same as what is written).
doc sprintf % probably will lead to more joy instead...
0 Comments
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!