0% found this document useful (0 votes)
14 views28 pages

Graficas 7 - 03 - 2017

The document provides examples of MATLAB code for plotting and graphing different types of functions and data. It includes examples of plotting sin and cos functions, logarithmic plots, polar plots, 3D surface plots, function plots, bar plots and pie charts. Multiple plotting commands are demonstrated including plot, loglog, semilogx, semilogy, polar, plot3, bar, barh, bar3, bar3h, pie, fplot and ezplot. Subplots are used to show multiple graphs in the same figure.

Uploaded by

D321012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views28 pages

Graficas 7 - 03 - 2017

The document provides examples of MATLAB code for plotting and graphing different types of functions and data. It includes examples of plotting sin and cos functions, logarithmic plots, polar plots, 3D surface plots, function plots, bar plots and pie charts. Multiple plotting commands are demonstrated including plot, loglog, semilogx, semilogy, polar, plot3, bar, barh, bar3, bar3h, pie, fplot and ezplot. Subplots are used to show multiple graphs in the same figure.

Uploaded by

D321012
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Did you mean:

>> x = 0:0.1:2*2*pi;

>> y1=sin(x);

>> x1=0:0.1:3*pi;

>> y2=2*cos(x1);

>> plotyy(x,y1,x1,y2)

>>

..
>> x=0.1:0.1:10;

y =2*x+3;

>> loglog(x,y)

>> x=0.1:0.1:10;

y =2*x+3;

>> loglog(x,y)

>> semilogx(x,y)
..

>> x=0.1:0.1:10;

y =2*x+3;

>> loglog(x,y)

>> semilogx(x,y)

>> semilogy(x,y)

subplot(2,2,2)
..

>> x=0.1:0.1:10;

y =2*x+3;

loglog(x,y)

semilogx(x,y)

semilogy(x,y)

>> subplot(2,2,2)

>> semilogx(x,y)

>> subplot (2,2,3)

>> semilogy(x,y)

>> subplot(2,2,4)

>> plot(x,y)

>> x=0:pi/20:2*pi;

>> subplot(2,1,1);

>> plot(x,sin(x))

>> subplot(2,1,2)

>> plot(x,sin(2*x))
..

X=0:50;

y = 5*x.^2 + 1;

>> plot(x,y)

>> x=0:0.5:50;
>> y=5*x.^2;

>> subplot(2,2,1)

>>

>> x=0:0.5:50;

>> y=5*x.^2;

>> subplot(2,2,1)

>> plot(x,y)

> x=0:0.5:50;

>> y=5*x.^2;

>> subplot(2,2,1)

>> plot(x,y)

>> title('Polinomial-lineal-lineal')

>> x=0:0.5:50;

>> y=5*x.^2;

>> subplot(2,2,1)

>> plot(x,y)

>> title('Polinomial-lineal-lineal')

>>

>> ylabel('y'),grid
..

>> x=0:0.5:50;

>> y=5*x.^2;

>> subplot(2,2,1)

>> plot(x,y)

>> title('Polinomial-lineal-lineal')

>>

>> ylabel('y'),grid

>> subplot(2,2,2)
>> semilogy(x,y)

>> x=0:pi/100:pi;

>> y=sin(x);

>> polar(x,y)

>>
>> x=0:pi/100:pi;

>> y=sin(x);

>> polar(x,y)

>> title('Funcion seno')


>> tetha=linspace(-pi,pi,100);

>> r=2-4*cos(tetha);

>> polar(tetha,r)

>> polar(x,y)

>>

>> polar(x,y)

..
>> t=0:0.05:2*pi;

>> r=sin(2*t).*cos(2*t);

>> polar(t,r,'--r')

>>
..

>> fplot('sin(x)',[-2*pi,2*pi])

..

fplot('sin(x)',[-2*pi,2*pi])

>> fplot('x^2',[-2 3],'g-.')


Definir escalas para el eje y

fplot('sin(x)',[-2*pi,2*pi])

>> fplot('x^2',[-2 3],'g-.')

>> fplot('5*x+3',[-3 3,-4 4],'b:')


Crear ventanas para graficas

>> fplot('sin(x)',[-2*pi,2*pi])

>> figure(2)
.

Comando

ezplot()

>> ezplot('x^2')
..

>> ezplot('x^2+y^2-64',[-10 12 -12 10])


GRAFICOS DE BARRAS

Definir el vector

> Y=[15 4 5 8 19 10 15 8 17];

graficar

>> subplot(2,2,1)

Y=[15 4 5 8 19 10 15 8 17];

>> subplot(2,2,1)

>> bar(Y)
PONER TITULOS

> Y=[15 4 5 8 19 10 15 8 17];

>> subplot(2,2,1)

>> bar(Y)

>> title('Barras Verticales')

>> subplot(2,2,2)

>> barh(Y)

>> title('Barras horizontales')


>> Y=[15 4 5 8 19 10 15 8 17];

>> subplot(2,2,1)

>> bar(Y)

>> title('Barras Verticales')

>> subplot(2,2,2)

>> barh(Y)

>> title('Barras horizontales')

>> subplot(2,2,3)

>> bar3(Y)

>> title('barras verticales 3D')


..

>> bar(Y)

>> title('Barras Verticales')

>> subplot(2,2,2)

>> barh(Y)

>> title('Barras horizontales')

>> subplot(2,2,3)

>> bar3(Y)

>> title('barras verticales 3D')

>> subplot(2,2,4)
>> bar3h(Y)

>> title('Barras horizontales 3D')

CUADO LOS DATPOS SON UNA MATRIZ

1 DEFINIOS EL VECTOR Y

>> y=[0 1 0 0 1]

y=

0 1 0 0 1
>> ni=[20 30 15 40 10]

ni =

20 30 15 40 10

>> pie(ni)

x=0:10;
y=0.5*(x+1).^2;
z=(x+y).^(1/4);
plot3(x,y,z,':r*').
grid on

x2=0:5;
y2=50-(x2+1).^2;
z2=(x.^2+y2.^2);
z2=(x2.^2+y2.^2).^(1/4);
hold on
plot3(x2,y2,z2.'--bd')

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy