The first part were M1=M2=0, I can't introduce the initial values for x1(0=Vector[ 0.1:0.1:2] the code that I used is:
f=@(t,x)[x(2);x(1)-2*x(1)^3];x1_cond=0.1:0.1:2;x2_cond=0;timespan=0:0.001:2;[t,x]=ode45(f,timespan,[x1_cond;x2_cond]);plot(t,x)
But there is a error for the initial conditions:
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
Please help me I am new using Matlab
Best Answer