How can I stop uicontrol from changing my scalar input to a vector?
Show older comments
I am building a GUI and have noticed that a few of my inputs have been converted from a scalar into a vector by a uicontrol function. Here is a sample code which shows that my scalar input being transformed into a vector matrix:
clc
fig=figure('Visible','on','Menu','none','Resize','off','NumberTitle','off','Name',...
'test3','Position',[50 50 500 500],'color',[0.7 0.7 0.7]);
x = 100
value_x = x
size_x = size(x)
scalar_x = isscalar(x)
hx = uicontrol('String',x,'Tag','x','Style','edit','Parent',fig,'Position',[100 192 40 15]);
value_hx = get(hx,'String')
size_hx = size(get(hx,'String'))
scalar_hx = isscalar(get(hx,'String'))
Any ideas on how to stop or work around this?
Thanks in advance for your help!
Accepted Answer
More Answers (0)
Categories
Find more on Data Types 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!