フィルターのクリア

function entering and plotimg

2 ビュー (過去 30 日間)
as banga
as banga 2011 年 6 月 30 日
hey, i want to input a function of t(time) in my edit text box.then i want this function to be plotted with respect to time in the axes.how can i do that.

採用された回答

Matt Fig
Matt Fig 2011 年 6 月 30 日
Here is another.
function [] = plot_ex()
% Help goes here.
S.fh = figure('units','pixels',...
'position',[200 300 420 420],...
'menubar','none',...
'name','plot_ex',...
'numbertitle','off',...
'resize','off');
S.ax = axes('units','pix',...
'position',[40 90 360 290]);
S.pb = uicontrol('style','push',...
'unit','pix',...
'position',[280 20 120 25],...
'string','push2plot',...
'callback',@pp_call,...
'fontweight','bold',...
'fontsize',12);
S.ed = uicontrol('style','edit',...
'unit','pix',...
'string','4*t^2*cos(t)',...
'position',[40 20 220 25]);
guidata(S.fh,S)
uicontrol(S.ed)
function [] = pp_call(varargin)
% Callback for the pushbutton.
S = guidata(gcbf);
ezplot(get(S.ed,'string'))

その他の回答 (1 件)

Paulo Silva
Paulo Silva 2011 年 6 月 30 日
function test123
figure
axes('Position',[0.2 0.2 0.7 0.7]);
pbh1 = uicontrol(gcf,'Style','pushbutton','String','New plot',...
'Position',[10 40 60 40],...
'callback',@newcomb);
tx = uicontrol(gcf,'Style','edit','String','',...
'Position',[10 10 600 30],'FontSize',20);
function newcomb(obj,ev)
cla
t=0:0.01:10;
f=get(tx,'String')
ezplot(f)
end
end

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by