How to Plot Natural Frequencies Against Velocity in MATLAB

How to Plot Natural Frequencies Against Velocity in MATLAB thumbnail
Use the Plot command to plot your two variables.

The natural frequency of an object is the rate at which it oscillates without any outside force or interference, and velocity refers to the speed at which an object moves in a certain direction. Numerous scenarios exist in which it would be useful to plot these variables graphically--for example, to compare the natural frequency of golf clubs against the velocity of the ball in order to find the optimal combination. In MATLAB, you can perform this and similar operations with the Plot command.

Instructions

    • 1

      Launch MATLAB. If you already have your data in a MATLAB file, click “File,” “Open,” browse to the directory that contains your data and then double-click the file to load it into MATLAB. Then proceed to Step 4. Otherwise, continue from Step 2.

    • 2

      Create a vector containing your natural-frequency data. Type the following into the command line and then press “Enter”:

      x = [1 2 3 4]

      Replace the example figures with your actual natural-frequency data.

    • 3

      Create a vector containing your velocity data. Type the following line into MATLAB and then press “Enter”:

      y = [1 2 3 4]

      As before, replace the example figures with your actual velocity values. The order at which the data points are entered in both vectors should be consistent. In the golf club example, the first number of each vector would represent the natural frequency and velocity in the first trial, the second pair of figures would represent the second trial and this pattern would hold for all entries.

    • 4

      Create the plot by typing the following command into MATLAB's command line editor and then pressing “Enter”:

      plot (x, y)

      If you chose to label your variables something other than “x” and “y,” be sure replace these with the actual names of your variables.

Related Searches:

References

  • Photo Credit BananaStock/BananaStock/Getty Images

Comments

Related Ads

Featured