matlab practice with solutions

matlab practice with solutions - Matlab Practice 1. Please...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Matlab Practice 1. Please use ‘help’ command to learn the following useful matlab build-in functions by yourself. abs, min, max, sum, ones, zeros, exp, log, sqrt, disp, input, load, length, size, trapz, spline, ode45, odeset,reshape, image, plotyy, linspace, subplot, rand, floor accelerate key: stop ctrl + C comment ctrl + R uncomment ctrl + T smart indent ctrl + I save and run F5 2. 2-D plotting clear % plot x = 0:pi/100:2*pi; y1 = sin(6*x); y2 = 2*cos(x); plot(x,y1,x,y2); Q : The code above generates a simple plot, can you add or change a few lines of code to make the plot like the two below? % add your code to make your plot like the % one on your right. 1 2 3 4 5 6 7-2.5-2-1.5-1-0.5 0.5 1 1.5 2 2.5 Plot of f(x)= sin(6*x) and 2*cos(x) x y sin(6*x) 2*cos(x) 1 2 3 4 5 6 7-2-1.5-1-0.5 0.5 1 1.5 2 % make changes to the original code to make % the plot like the one on your right 3. function m-file x = aV + b , y = bV – a, where a=2, b=3. Try to construct a function m-file to make 2D plot for x x = aV + b , y = bV – a, where a=2, b=3....
View Full Document

This note was uploaded on 04/12/2009 for the course BME 210 taught by Professor D'argenio during the Spring '07 term at USC.

Page1 / 4

matlab practice with solutions - Matlab Practice 1. Please...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online