string joining without inverted commas and variable pass in string.
Mostrar comentarios más antiguos
Hello everyone,
I am trying to join two strings and then I need to have it as character and remove all the single or double inverted commas on it.
Also, how to give one input as variable.
for example.
"obj.UI.knob_" + "4" + ".Value"
here "4" is variable and it should change.
At the end I should have- obj.UI.knob_4.Value and not "obj.UI.knob_4.Value" i.e I dont need inverted commas.
I request to pleae help in removing the inverted commas, and how to pass variable in it.
Thanking you,
Kind regards
1 comentario
Stephen23
el 6 de Jun. de 2024
"I request to pleae help in removing the inverted commas"
The "inverted commas" are not a part of the text, there are purely an artifact of the display routine. You are confusing how data is displayed in the command window with the data itself.
Respuesta aceptada
Más respuestas (1)
Matlab Pro
el 6 de Jun. de 2024
1st - use a single 'postrophe': ' instead of "
I have created a simple function that returnes the value of a Knob.
Add this function to your app
function out = ret_Knob_value(obj,num)
eval(['out = obj.Knob' ,num2str(num), '.Value;']);
Good luck!
1 comentario
Paramjit Yadav
el 6 de Jun. de 2024
Categorías
Más información sobre Electrical Block Libraries 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!