1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Matlab Plot

  1. Mar 6, 2009 #1
    How do i plot an output response curve when input unit steps are (undamped natural frequency is normalised to 1):

    damping ration = 0, 0.1, 0.4,0.6,0.8,0.9 1 and 2

    1) how do i plot a 2d plot for all curves on same graph. Time scale 0 - 10, steps of 0.2 seconds.
    2) How do i make use of a 'for loop' to generate step response for the damping ratios,
    3) How do i produce an m file to obtain response.
    4) how can i produce a 3d plot
    5)how do i produce a Matlab program to get rise time, peak time, settling time and max overshoot of the 2nd order system [for equation 10/ 2s^2 + 4s +15]
  2. jcsd
  3. Mar 6, 2009 #2


    User Avatar
    Science Advisor

    From your PM, I'd recommend that you ask your prof for materials / a lecture / lab on MATLAB, especially if you [collectively you, meaning you and your classmates] have never used it before. If learning MATLAB by yourself *is* part of this course, then you should probably read the textbook (if provided) or go through some of the http://www.mathworks.com/academia/student_center/tutorials/launchpad.html" [Broken], and/or go through the following thread:

    1) Assuming you have data for each of the graphs you wish to plot:

    3) An m-file allows you to automate a sequence of commands. Instead of typing out 20 commands each and every time you want to do something, you type out the 20 commands in the m-file, and just type the name of the m-file (assuming it's in the current directory) to execute these commands. You can start a new m-file by going File > New m file (or something similar). Getting started with m scripts:
    http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f7-38085.html#f7-60588 [Broken]

    2) The 'for' loop in MATLAB:

    4) Producing a (basic) 3d plot:

    Note that you can generate various 3D surface plots using, for instance, mesh and surf:

    5) Take a look at the following Wikibook on using MATLAB for Control Systems:
    Last edited by a moderator: May 4, 2017
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook