{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture+7-Matlab+programming

Lecture+7-Matlab+programming - x=0:0.1:10 y=sin(2*pi*x...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
» x=0:0.1:10; » y=sin(2.*pi*x)+cos(pi*x); » H1=plot(x,y,'m'); set(H1,'LineWidth',3); hold on; » H2=plot(x,y,'bO'); set(H2,'LineWidth',3,'MarkerSize',10); hold off; » xlabel('x'); ylabel('y'); » title('y = sin(2\pix)+cos(\pix)'); » print -djpeg075 function.jpg
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
» x=0:0.1:3; y1=exp(-x); y2=sqrt(x); » H=plot(x,y1,'b-',x,y2,'r--'); » set(H,'LineWidth',3) » xlabel('x'); ylabel('y'); title('MATLAB Plots'); » H1=text(1.8,0.2,'exp(-x)'); set(H1,'FontSize',18); » H2=text(1.8,1.3,'sqrt(x)'); set(H2,'FontSize',18);
Image of page 2
» text (17, 120, Record High ) » text (85, -40, Record Low ) » axis ([0 100 -50 140]) » hold off text ( x_location, y_location, text ) axis ( [ x_min x_max y_min y_max ] ) - text string Graphics Commands Text & Axis
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Chapter 3 Programming with MATLAB
Image of page 4
Newton’s Second Law Euler’s method To obtain good accuracy, it is necessary to use many small steps Extremely laborious and time-consuming to implement by hand Numerical Solution 2 d 2 d v m c g dt dv v c mg dt dv m - = - = ) ( ) ( ) ( ) ( i 1 i 2 i d i 1 i t t t v m c g t v t v - - + = + +
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
M-Files: Scripts and Functions You can create and save code in text files using MATLAB Editor/Debugger or other text editors (called m-files since the ending must be .m)
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern