How to put an fprintf as a result in a Static text box in my Interface?
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to do this
outputsem=fprintf('It is predicted to have a level of distribution of %g m^3 will be presented on week: %g \n\n Logisti-K will have to pay %g USD to cover the level of distribution mentioned.\n ',xinter,sqroot,Totalcost)
end
set(handles.rr1,'string', sprintf(outputsem));
Is it correct? I still cannot verify it because my code doesn´t run (because of some input errors), but I want to make sure everything else is correct.
Thank you!
3 件のコメント
Gabriel Aviles
2020 年 5 月 20 日
Hello! I have been experiencing a similar problem. I tried the code you provided, but my outcome is still wrong.
Instead of displaying the text, it display a number
aaa = fprintf('Thanks for your help. Remember to always update information when possible')
set(handles.text9, 'String', aaa)
Walter Roberson
2020 年 5 月 20 日
Gabriel Aviles that is expected.
nbytes = fprintf(___) returns the number of bytes that fprintf writes, using any of the input arguments in the preceding syntaxes.
So the number you are getting is the number of bytes processed by fprintf().
Read JESUS's answer for what you should be using instead.
回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!