From: Peter van Laeys on
I am trying to interpret a section of code that looks like this:

for i = 1:6
t_inner = ti + a(i)*h;
y_inner = yi;
for j = 1:i-1
y_inner = y_inner + h*b(i,j)*f(:,j);
end
f(:,i) = feval(ode_function, t_inner, y_inner);
end

I don't think that the code is necessary to answer my question but I wasn't sure.

The part I don't understand is f(:,j) or f(:,i); what does this syntax mean?
From: samah karim on
"Peter van Laeys" <pvanlaeys(a)gmail.com> wrote in message <hovpvh$hdn$1(a)fred.mathworks.com>...
> I am trying to interpret a section of code that looks like this:
>
> for i = 1:6
> t_inner = ti + a(i)*h;
> y_inner = yi;
> for j = 1:i-1
> y_inner = y_inner + h*b(i,j)*f(:,j);
> end
> f(:,i) = feval(ode_function, t_inner, y_inner);
> end
>
> I don't think that the code is necessary to answer my question but I wasn't sure.
>
> The part I don't understand is f(:,j) or f(:,i); what does this syntax mean?

well f is a matrix obviously, and f(:,j) is the jth column of that matrix. it's a vector now and you can manipulate it as such. same goes for f(:,i)
From: samah karim on
"Peter van Laeys" <pvanlaeys(a)gmail.com> wrote in message <hovpvh$hdn$1(a)fred.mathworks.com>...
> I am trying to interpret a section of code that looks like this:
>
> for i = 1:6
> t_inner = ti + a(i)*h;
> y_inner = yi;
> for j = 1:i-1
> y_inner = y_inner + h*b(i,j)*f(:,j);
> end
> f(:,i) = feval(ode_function, t_inner, y_inner);
> end
>
> I don't think that the code is necessary to answer my question but I wasn't sure.
>
> The part I don't understand is f(:,j) or f(:,i); what does this syntax mean?

well f is a matrix obviously(or a 2 dimensional array). and f(:,j) is the jth column of that matrix. it's a vector now and you can manipulate it as such. same goes for f(:,i).
hope I answered ur question.