>> A=[1,2,3; 4,5,6; 7,8,9]
A =
- 1 2 3
- 4 5 6
- 7 8 9
>> b=A(2:3,1:2)
b =
- 4 5
- 7 8
Tanbién es posible concatenar matrices:
>> cat (1,b,b)
ans =
- 4 5
- 7 8
- 4 5
- 7 8
>> cat(2,b,b)
ans =
4 5 4 5
7 8 7 8
Nuevamente podemos graficar los elementos de una matriz, escribimos el siguiente código en un archivo.m:
x=1:1:3;
plot(A(x,1));
title('function ');
xlabel('dominio');
ylabel('f(x)');
legend('y=f(x)')
Y al ejecutarlo tenemos (haz click en la imagen para agrandar):
Para graficar en 3D podemos usar plot3:
>> t = 0:pi/50:10*pi;
plot3(sin(t),cos(t),t)
grid on
axis square
Lo cual muestra el siguiente gráfico:
No hay comentarios:
Publicar un comentario