Docsity

Gráficas en MatLab: Proyectil, Población de Estados Unidos y Funciones, Ejercicios de Programación C

Toggle sidebar
bg1
Gráficas en MatLab
1.-Un proyectil se dispara con un ángulo θ=60° y una
velocidad inicial () de 600m/s. Desarrolla el código en el editor
para obtener: el alcance horizontal (), la altura máxima () y el
tiempo de vuelo del proyectil (), desde que sale hasta que
impacta con el suelo
pf3
pf4
pf5

Vista previa parcial del texto

¡Descarga Gráficas en MatLab: Proyectil, Población de Estados Unidos y Funciones y más Ejercicios en PDF de Programación C solo en Docsity!

Gráficas en MatLab

1.-Un proyectil se dispara con un ángulo θ=60° y una

velocidad inicial () de 600m/s. Desarrolla el código en el editor

para obtener: el alcance horizontal (), la altura máxima () y el

tiempo de vuelo del proyectil (), desde que sale hasta que

impacta con el suelo

Usar la función seno para grados

g=9.8m/s^

Script

  1. vo=600;
  2. g=9.8;
  3. a=60;
  4. xmax=(vo.^2/g).(sind(2.a))
  5. ymax=(vo.^2/2g).((sind(a)).^2)
  6. tvuelo=(2(vo/g)).(sind(a))
  7. plot(xmax,ymax,'cp')
  8. title('Proyectil')
  9. xlabel('Xmax')
  10. ylabel('Ymax')
  11. legend('Alcance')
  12. grid on

Command Window

proyectil xmax = 3.1813e+ ymax = 1323000 tvuelo =

  1. subplot(2,3,1)%G.

  2. plot(x,sin((sqrt(x.^2+8))),'r*')

  3. title('sin(sqrt.(x.^2+8))')

  4. xlabel('Eje x')

  5. ylabel('Eje y')

  6. grid on

  7. legend('sin(sqrt(x.^2+8))')

  8. (^) subplot(2,3,2)%G.

  9. plot(x,pi.*x.^2,'mp')

  10. title('pi.*x.^2')

  11. xlabel('Eje x')

  12. ylabel('Eje y')

  13. grid on

  14. legend('pi.*x.^2')

  15. subplot(2,3,3)%G.

  16. plot(x,z,'y')

  17. title(' sin(sqrt(x.^2 + y.^2))./(sqrt(x.^2 + y.^2+0.1))')

  18. xlabel('Eje x')

  19. ylabel('Eje y')

  20. grid on

  21. legend(' sin(sqrt(x.^2 + y.^2))./(sqrt(x.^2 + y.^2+0.1))')

  22. subplot(4,3,7)%G

  23. plot(x,(x+3).^(1/3),'g*')

  24. title('(x+3).^(1/3)')

  25. xlabel('Eje x')

  26. ylabel('Eje y')

  27. grid on

  28. (^) legend('(x.+3).^(1/3)')

  29. subplot(4,6,15)%G

  30. plot(x,exp(-x.^5),'cp')

  31. title('exp(-x.^5)')

  32. xlabel('Eje x')

  33. ylabel('Eje y')

  34. grid on

  35. legend('exp(-x.^5)')

  36. subplot(2,2,4)%G

  37. plot(x,cos(sqrt(x.^2+2)),'rd')

  38. title('cos(sqrt(x.^2+2))')

  39. xlabel('Eje x')

  40. ylabel('Eje y')

  41. grid on

  42. legend('cos(sqrt(x.^2+2))')

  43. subplot(4,2,7)%G

  44. plot(x,(sin(x).*x).^(1/3),'c<')

  45. title('(sin(x).*x).^(1/3)')

  46. xlabel('Eje x')

  47. ylabel('Eje y')

  48. (^) grid on

  1. legend('(sin(x).*x).^(1/3)')
  2. %End

4.- Gráficas: Ejercicio en clase

  1. clear all, close all, clc
  2. x=-2pi:0.1:2pi
  3. subplot(3,4,9)%G.
  4. plot(x,x.^3,'r*')
  5. title('x^3')
  6. xlabel('Eje x')
  7. ylabel('Eje y')
  8. grid on
  9. legend('x^3')
  10. (^) subplot(3,4,10)%G.