How to put an fprintf as a result in a Static text box in my Interface?

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Gabriel Aviles
Gabriel Aviles il 20 Mag 2020
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
Walter Roberson il 20 Mag 2020
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.

Accedi per commentare.

Risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by