mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Added matlab code samples.
All of these code samples currently are mis-identified in my repositories. I'm donating them to the cause.
This commit is contained in:
19
samples/Matlab/test_rk_par.m
Normal file
19
samples/Matlab/test_rk_par.m
Normal file
@@ -0,0 +1,19 @@
|
||||
clear
|
||||
mu=0.1;
|
||||
x_0=linspace(-0.8, -0.15, 2)
|
||||
y_0=zeros(1,2)
|
||||
vx_0=linspace(-2, 2, 2)
|
||||
vy_0=zeros(1,2)
|
||||
ci=[1-mu-0.05 0 0.005 0.5290]
|
||||
t0=[0;0]
|
||||
T=[2;2]
|
||||
tspan=2
|
||||
arg1={@f;@f}
|
||||
%tspan={[0 2],[0 2]};
|
||||
arg=[mu;mu]
|
||||
[X]=arrayfun(RK4_par,t0,T,x_0',y_0',vx_0',vy_0',arg)
|
||||
% [X]=arrayfun(@f,[0;1],[ci;ci],[mu;mu]);
|
||||
%Y=RK4(@f,tspan,ci,mu);
|
||||
% figure
|
||||
% plot(Y(:,1),Y(:,2))
|
||||
% Y(end,1)
|
||||
Reference in New Issue
Block a user