GUI draw two straight line by straight line equation in same graph.

3 ビュー (過去 30 日間)
Md Nafiul Islam
Md Nafiul Islam 2017 年 12 月 21 日
編集済み: Walter Roberson 2017 年 12 月 21 日
Hey guys,
I am new to GUI programming. Please help me to make two straight line by straight line equation by GUI. I have used two push button but the combination of two graphs is not showing and I need a point of the two line. I have tried to make this code.
Here is the example-code:
c = str2num(get(handles.c,'String'));
e = str2num(get(handles.e,'String'));
a1= str2num(get(handles.a1,'String'));
%a2= str2num(get(handles.a2,'String'));
%slope = num2str(-e/tan(a1));
int1 = num2str(c*tan(a1));
%int2 = num2str(c*tan(a2));
set(handles.s2,'String',int1);
%set(handles.s3,'String',int2);
x = -10:10;
y1 = c*tan(a1)*x+e;
%y2 = c*tan(a2)*x+e;
axes(handles.axes1);
plot(x,y1);
%plot(x,y2);
xlabel('x');
ylabel('h');
handles.f=f;
guidata(hObject,handles)
c = str2num(get(handles.c,'String'));
e = str2num(get(handles.e,'String'));
%a1= str2num(get(handles.a1,'String'));
a2= str2num(get(handles.a2,'String'));
%slope = num2str(-e/tan(a1));
%int1 = num2str(c*tan(a1));
int2 = num2str(c*tan(a2));
%set(handles.s2,'String',int1);
set(handles.s3,'String',int2);
x = -10:10;
%y1 = c*tan(a1)*x+e;
y2 = c*tan(a2)*x+e;
axes(handles.axes1);
%plot(x,y1);
plot(x,y2);
xlabel('x');
ylabel('h');
handles.g=g;
guidata(hObject,handles)
res = conv( f, g, 'same' );

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by