Setting static text box's string

2 visualizaciones (últimos 30 días)
Onur Öçalan
Onur Öçalan el 14 de Jul. de 2011
Hi everybody
I create a gui and a after static text box which is named frameText.I want to change it's string with this code .
set(handles.frameText , 'String' , 'abcdefgh' );
But an error occurs.
??? Subscript indices must either be real positive integers or logicals.
What is the reason for this? Thanks for help...

Respuesta aceptada

Friedrich
Friedrich el 14 de Jul. de 2011
Hi,
I agree with Paulo. Maybe run a
dbstop if error
and than start your code. You will get into the debug mode when the error is raised. This will help you to figure out the line where the error is thrown and you can look at the variable at this point.

Más respuestas (3)

Jan
Jan el 14 de Jul. de 2011
You have created a variable call "set". Then the shown line does not call the built-in command SET anymore, but tries to use the string parameters as indices.

Paulo Silva
Paulo Silva el 14 de Jul. de 2011
Are you really sure that the error is caused by that line of code? I'm not :)

Onur Öçalan
Onur Öçalan el 14 de Jul. de 2011
Thanks for help. I found it. :)

Categorías

Más información sobre Characters and Strings 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