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

3 views (last 30 days)
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' );

Answers (0)

Categories

Find more on Numerical Integration and Differential Equations 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!