
Como crear grafica a partir de una tabla
Publicado por gerardo (1 intervención) el 25/02/2014 19:58:28
Que tal, necesito graficar puntos a partir de una tabla en gui
mi tabla es de 61x5, ocupo grafica columna 1 contra columna 2, columna 1 contra columna 3 y asi, el caso es que necesito la sintaxis para decirle a plot que lo grafique, pense en podia con plot(num_elem(2:61,1),num_elem(2:61, 2)) pero no lo hace, me seria de mucha ayuda una orientacion, gracias, este es mi avanze:
mi tabla es de 61x5, ocupo grafica columna 1 contra columna 2, columna 1 contra columna 3 y asi, el caso es que necesito la sintaxis para decirle a plot que lo grafique, pense en podia con plot(num_elem(2:61,1),num_elem(2:61, 2)) pero no lo hace, me seria de mucha ayuda una orientacion, gracias, este es mi avanze:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
function valores_Callback(hObject, eventdata, handles)
% hObject handle to valores (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
num_elem=cell(60,5);
num_elem(1,1)={'tetha'};
num_elem(1,2)={'x(theta)'};
num_elem(1,3)={'v(theta)'};
num_elem(1,4)={'a(theta)'};
num_elem(1,5)={'j(theta)'};
theta=0;
R=str2double(get(handles.R,'String'));
L=str2double(get(handles.L,'String'));
w=str2double(get(handles.w,'String'));
wrs=num2str((2*3.1416*(w))/60);
set(handles.wrs,'String',wrs);
col=str2double(get(handles.col,'String'));
for k=2: 1: 61
theta=theta+6;
num_elem(k,1)={theta};
end
for k=2: 1: 61
theta=theta+6;
x=R*(1-cos(theta))+L*(1-(1-(R^2/L^2)*sin(theta)*sin(theta))^(1/2));
num_elem(k,2)={x};
end
for k=2: 1: 61
theta=theta+6;
v=R*w*(sin(theta)+(R/2*L)*((sin(2*theta)/(2*(1-(R^2/L^2)*sin(theta)*sin(theta))^(1/2)))))
num_elem(k,3)={v};
end
for k=2: 1: 61
theta=theta+6;
a=R*w^2*(cos(theta)+(R/4*L^3)*((4*L^2*(1-(R^2/L^2)*sin(theta)*sin(theta)*cos(2*theta)+R^2*sin(2*theta)*sin(2*theta)))/(1-(R^2/L^2)*sin(theta)*sin(theta))^(3/2)))
num_elem(k,4)={a};
end
posicion=num_elem(2:61,1);
set(handles.uitable1,'Data',num_elem);
set(handles.uitable1,'ColumnEditable',true(1,col));
axes(handles.axes1);
grid on;
%plot(num_elem(2:61,1),num_elem(2:61,2));
Valora esta pregunta


0