error al usar plot con una funcion de uicontrol

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

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by