I am looking at Palm's "Introduction to MatLab 7 for Engineers" page 511. The problem involves solving a Second Order Diff Equation. The solution to the diff equation is straight forward. What I am wondering is what Plam is doing in the plot function?(adsbygoogle = window.adsbygoogle || []).push({});

[tex] \ddot{\Theta} + \frac {g} {l} sin \Theta = 0 [/tex]

His answer is below:

in the m file pendul:

function xdot = pendul(t,x)

global g L

xdot = [x(2); -(g/L)*sin(x(1))];

in the m file example8_6_1

global g L

g = 9.81;

L = 1;

[ta, xa] = ode('pendul', [0,5], [0.5,0]);

plot(ta,xa(:,1), xlabel('Time (s)'), ylabel('Angle(rad)')

Question:

In the plot(ta,xa(:,1) what is the (:,1)? What is he doing? And why couldn't he just put an xa without the (:,1)?

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MatLab Question

Loading...

Similar Threads for MatLab Question | Date |
---|---|

MatLab function question | Sep 5, 2015 |

Contour question in matlab | Feb 9, 2015 |

LaTeX Concept and subject of latex and its usage and related questions on latex | Sep 25, 2014 |

MATLAB A question on linear algebra(also Matlab related) | Jun 23, 2014 |

Computing question 1st year Engineering-MATLAB | Apr 22, 2014 |

**Physics Forums - The Fusion of Science and Community**