how to use function to output code to control GUIDE
Mostrar comentarios más antiguos
In my GUIDE, user can adjust number and then the display item will change.
I have already wrote a code like this:
for i=1:maxnumber
k1=eval(['handles.TD',num2str(i),'X']);
k2=eval(['handles.TD',num2str(i),'Y']);
k3=eval(['handles.TD',num2str(i),'R']);
k4=eval(['handles.TD',num2str(i),'AMP']);
k5=eval(['handles.TD',num2str(i),'CD']);
set(k1,'visible','on');
set(k2,'visible','on');
set(k3,'visible','on');
set(k4,'visible','on');
set(k5,'visible','on');
end
The key is last four "set" statement.
Now I want to write a function so I don't need to type this every time.
The code for function is the same as above.
But how can I use function to output "set" statement to control GUIDE?
Also, I found out I cannot use handles in function....is there a solution?
1 comentario
@herb: using eval is not a good way to achieve this, as the blogs, documentation, and this forum have explained multiple times before:
etc, etc
Respuesta aceptada
Más respuestas (1)
Categorías
Más información sobre Debugging and Improving Code 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!