error al usar plot con una funcion de uicontrol

1 view (last 30 days)
Hola, lo que pasa es que el siguiente codigo no me corre y si bien se que el problema esta en la variable que toma el valor de lo que ingrese, no se como solucionarlo
codigo:
function aaaa
f=figure('position',[100 100 1000 580]);
panel=uipanel(f,'Position',[0.1 0.6 0.4 0.4]);
title1=uicontrol('Style','text','string','d',...
'Position',[90 540 160 20]);
txt1=uicontrol('Style','edit','Position',[240 540 220 25],...
'callback',@getv);
btn=uicontrol('Style','pushbutton','Position',[190 450 170 25],...
'String','cxc','KeyPressFcn','Enter');
end
function q=getv(atr,evento)
subplot(2,1,2);
t = linspace(-30,30);
y1 = 3*t;
plot(t,y1)
hold on
y2 = t.^3;
plot(t,y2)
y3=get(atr,'String');
plot(t,y3)
hold off
end
El error que me sale es el siguiente:
Error using plot
There is no HorizontalAlignment property on the Line class.
Error in Untitled4>getv (line 22)
plot(t,y3)
Error while evaluating UIControl Callback

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!