Borrar filtros
Borrar filtros

How can I save string data as double in Userdata GUI?

1 visualización (últimos 30 días)
Nicolas Rodriguez
Nicolas Rodriguez el 26 de En. de 2016
Respondida: Nicolas Rodriguez el 10 de Mayo de 2016
I am working with radiobuttons in Matlab GUI. I want that everytime I press a radiobutton, a word stored in the UserData box prints using fprintf. I have the fprintf part figured out, however, I have been trying to save the words using the inspector UIcontrol window for every radiobutton but it doesn't work. Any help?
Thanks!

Respuestas (2)

Walter Roberson
Walter Roberson el 26 de En. de 2016
At the MATLAB command line, take the string you want and double() it, such as
double('this is the first string')
The result will be a vector of numbers that you should be able to store.
Then when it comes time to fprintf() the userdata,
TheUserData = get(hObject, 'UserData');
fprintf('%s', char(TheUserData));

Nicolas Rodriguez
Nicolas Rodriguez el 10 de Mayo de 2016
thank you very much, it worked!

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by