From: Takis on
Hi there,

I have a a vector V=[X Y Z] (438x3)

and the following array
A=time: [438x1 double]
pos: [438x3 double]
Vel: [438x3 double]
F: [438x4 double]

I would like to ask you please how i should write a for loop so the following function to run through the data row by row.

[Output] = function(V,A)


Many thanks in advance!
From: ImageAnalyst on
And what kind of data do you want to be in the "Output" argument?
From: Takis on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <270e62f8-5a36-4982-9296-621ad457411f(a)z11g2000yqz.googlegroups.com>...
> And what kind of data do you want to be in the "Output" argument?


Thanks a lot for your reply!! I would like to be a 438 x 4 vector!!

Time X Y Z
From: Nathan on
On Feb 24, 3:30 pm, "Takis " <dts...(a)remove.this.vip.gr> wrote:
> ImageAnalyst <imageanal...(a)mailinator.com> wrote in message <270e62f8-5a36-4982-9296-621ad4574...(a)z11g2000yqz.googlegroups.com>...
> > And what kind of data do you want to be in the "Output" argument?
>
> Thanks a lot for your reply!! I would like to be a 438 x 4 vector!!
>
> Time X Y Z

If you just want your Output variable to contain Time X Y Z, then you
can simple do this (assuming you know X, Y, and Z, and assuming A is a
structure with time, pos, Vel, and F as arrays within this structure)

Output = [A.time X Y Z]

If this doesn't work for you, could you please be more specific as to
what you are looking for?
Why do you want a function to go through your data row by row? What is
the purpose for that?

-Nathan
From: ImageAnalyst on
Takis

OK, how about this:

function Output = ReturnOutput(V, A)
Output = rand(438, 4);

It meets your (extremely limited) criteria.
Will that work for you? Otherwise how are we supposed to know what's
supposed to be IN the 438 by 4 array?