If you have a predefined no. of ic
you can use this for loop:
for i=1:NoOfic
test_mat(i,:)=test_ode_45(x(i),tspan);
end
You should predefine your matrix (test_mat) in a sufficient dimension e.g.
test_mat = zeros(NoOfic, SizeOftspan)
Obviously I have defined the variables NoOfic
and SizeOftspan
to the specific numbers
My whole test-code is:
tspan = 1:0.02:2;
x= [0.4 0.8 1.2 1.5 2.6];
sizeOftspan = size(tspan);
sizeOfFamily= size(x);
test_mat = zeros(sizeOfFamily(2),sizeOftspan(2));
test_tes= test_ode_45(x(1),tspan);
for i=1:sizeOfFamily(2)
test_mat(i,:)=test_ode_45(x(i),tspan);
end
plot(tspan, test_mat)
Where my test_ode_45
function is a simple x*sin(t) function