[julia-users] Dimension mismatch error in Julia!

2015-03-10 Thread Kacem HARIZ
*Here is the code:*

*w=1;*
*γ=0.01;*
*f(x,y)= [y;-w^2*sin(x)-u*w^2*cos(x) -2γ*y];*

*for i=1:sizeof(Sx)*
*x0=Sx[i+2];*
*y0=Sy[i+2];*
*for j=1:sizeU*
*u=U[i];*
*t,NX=ODE.ode45(f,[0,0.1],[x0,y0])*
*end*
*end*

with Sx and Sy vectors of the same size, and U an other vector of size 
sizeU.

*and here is the error message:*

mismatch in dimension 1
while loading In[69], in expression starting on line 5

 in cat at abstractarray.jl:631
 in hcat at abstractarray.jl:671
 in hvcat at abstractarray.jl:966
 in f at In[69]:3
 in oderkf at /home/juser/.julia/v0.3/ODE/src/ODE.jl:208
 in ode45_dp at /home/juser/.julia/v0.3/ODE/src/ODE.jl:303
 in anonymous at no file:10

Does anyone know how to fix it, please let me know, I'd be very grateful!


[julia-users] Dimension mismatch error in Julia!​

2015-03-10 Thread Kacem HARIZ


I got stuck by an error in Julia! please I need help!

*here is the code:*

 
*w=1;*
*γ=0.01;*
*f(x,y)= [y;-w^2*sin(x)-u*w^2*cos(x) -2γ*y];*

*for i=1 : numberOfStates*
*x0=Sx[i+2];*
*y0=Sy[i+2];*
*for j=1:sizeU*
*u=U[i];*
*t,NX=ODE.ode45(f(x,y,u),[0,0.1],[x0,y0])*
*end*
*end*

with Sx and Sy two vectors of the same size, and U is a vector of size 
sizeU.

*and here is the error message:*

mismatch in dimension 1
while loading In[94], in expression starting on line 5

 in cat at abstractarray.jl:631
 in hcat at abstractarray.jl:671
 in hvcat at abstractarray.jl:966
 in f at In[90]:3
 in oderkf at /home/juser/.julia/v0.3/ODE/src/ODE.jl:208
 in ode45_dp at /home/juser/.julia/v0.3/ODE/src/ODE.jl:303
 in anonymous at no file:10


Best regards,
Kacem