My book explains the command x(:,1) as "x,all rows,first column".(adsbygoogle = window.adsbygoogle || []).push({});

Q.How does the output of ode45 for a system of differential equations look like?

But,when I solve a system of 2 first order differential equations(w.r.t time),I take x as a "column vector".

[x1

x2]

So,if I wanted to plot x(1) which is the first row of the column vector,I should write plot(t,x(1)) right? MATLAB gives an error.

MATLAB however accepts this ''plot(t,x(:,1))'',which literally means plotting all rows,1st column x versus t.

I dont get it.x has only 1 column and 2 rows.Where is the question of 1st and 2nd column in x?

**Physics Forums | Science Articles, Homework Help, Discussion**

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

# X(:,1) command in matlab

**Physics Forums | Science Articles, Homework Help, Discussion**