Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
Md Nafiul Islam
Md Nafiul Islam el 21 de Dic. de 2017
Editada: Walter Roberson el 21 de Dic. de 2017
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' );

Respuestas (0)

Categorías

Más información sobre Directed Graphs en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by