how to use function to output code to control GUIDE
Show older comments
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 Comment
@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
Accepted Answer
More Answers (1)
Categories
Find more on Debugging and Improving Code in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!