Why can't uitable accept strings in 2018b update while uicontrol can accept strings?
Mostrar comentarios más antiguos
With the release of MATLAB 2018b, a lot of function inputs accept strings as well as char arrays. I'm converting an application with programmatic UI elements and decided to convert these to strings as much as possible as well as using strings is now encouraged by MATLAB. This goes fine for most UI elements, for example:
uicontrol(f, "Position", [0.2 0.2 0.2 0.2], "String", "Hello")
uicontrol(f, "String", "Hello", "Tag", "Test String")
However, using quotes for uitable puts up a variety of errors, for example:
uitable(f, "Tag", "Test Table")
produces both a warning and an error, while
uitable(f, 'Tag', 'Test Table')
is fine. Other series of parameters with quotes produce different errors. And, compared to other UI elements, uitable seems less willing to have strings for its properties. The ColumnName property accepts a string, but ColumnFormat does not.
Is there a particular reason that uitable was mostly left out when it came to the ability to use strings?
3 comentarios
You can still use a string to specify a property; but you can't to name the property. For example, this does not produce an error nor a warning in 2018b:
uitable(f, 'Tag', "Test Table")
I can't speculate on the motivation for this, though.
Craig DeAlmeida
el 26 de Sept. de 2018
Editada: Craig DeAlmeida
el 26 de Sept. de 2018
Adam Danz
el 26 de Sept. de 2018
Yeah, definitely a bug as Walter pointed out.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!