passing a matrix to ode45: ode45('fname',tspan,matrix,options)
Show older comments
Hi all,
I am 'recoding' some code written by my professor that integrates a PDE over a 2D lattice.
It appears that he passes the 2D initial condition to ode45() without reshaping it first, and that ode45 automatically reshapes it...I didn't know you could do this? I can't find any documentation on this, but it looks like that is exactly what is happening.
Am I missing something here?
Code:
whos Y0
% confirms 21x21
pause();
[T,Y]=ode45('eqNLS2D_sat',tspan,Y0,options,Nx,Ny);
function [F]=eqNLS2D_sat(t,Y,flag,Nx,Ny)
global C gamma mu V VV LAP;
whos Y
%confirms 441x1
pause();
Y2=Y.*conj(Y);
F=(-LAP*Y+gamma*Y./(1+Y2)+VV.*Y)/1i;
Will
1 Comment
Andrei Bobrov
on 7 Aug 2011
where the code?
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!