looping problem



hoi people,

i just starting to write with perl and have a problem i can't solve.

i hope someone can help me.

mine program is somekind of a mathematical solver.

my program works as follows.

a user gives 7 $ARGV ( numeric).

then these argument run in a for loop. the outcome is then exported to
an txt.file as a table.



( so far this works great).

example of mine table:
x1 x2 Ra Rb Rc Mm
================================================================================
0.0 -5.0 -10.00 0.00 0.00 0.00
1.0 -4.0 -9.38 -0.75 0.12 2.49
2.0 -3.0 -8.75 -1.49 0.25 4.95
3.0 -2.0 -8.13 -2.23 0.37 7.33
4.0 -1.0 -7.52 -2.96 0.48 9.60
5.0 0.0 -16.91 -3.67 0.59 11.72
6.0 1.0 -15.69 -5.11 0.81 16.14
7.0 2.0 -14.48 -6.53 1.02 20.31
8.0 3.0 -13.29 -7.91 1.21 24.13
9.0 4.0 -12.12 -9.25 1.38 27.54
10.0 5.0 -10.98 -10.55 1.52 30.47





this is the tricky part i can't solve.

every colom as you can see above.(x1,x2,ra,rb,rc,mm).
has to be used in a loop, line by line.
when the loop is done it has to read al of the second row values.
and run it again in the loop.
..

i have tried some different thing put it does not work.

i have put an extra for loop statement at the beginning. this gave me
the loop values (xs) as i expexted but, it repeats al of the table
values to.

x1 x2 xs Ra Rb Rc MM
================================================================================
0.0 -5.0 0.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 5.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 10.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 15.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 20.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 25.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 30.00 | -10.00 0.00 0.00
0.00
0.0 -5.0 35.00 | -10.00 0.00 0.00
0.00
5.0 0.0 0.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 5.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 10.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 15.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 20.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 25.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 30.00 | -14.38 -5.94 0.31
6.25
5.0 0.0 35.00 | -14.38 -5.94 0.31
6.25

the values of (x1,x2,ra,rb,rc,mm) has to be used and printed one time.

for example:
the values of (x1.x2,ra,rb,rc,mm) are put in an array separetly and
then put in an formula that uses al of the values from the (xs) loop.
when this loop is done. it has to reas the second line values and put
in the same loop.

i hope some can help me with finding a method to solve this.


thanks,

.



Relevant Pages

  • Re: Easy in Excel, more tricky in Matlab
    ... I would like to replicate what I have in Excel into Matlab but I am having a few difficulties with the loop. ... I need to take the first row of A and add it to the first row of B and output this in the column of B in the second row below the zero. ...
    (comp.soft-sys.matlab)
  • Re: Performing calculations on values of multiple matrices
    ... Have you considered stackin matrices into a 3D array then ... loop on the z dimension? ... Then pick the second row of each one of the ...
    (comp.soft-sys.matlab)
  • Delete a range of rows ?
    ... that this code only delete every second row. ... Loop ... Mit fotoalbum ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: How to loop
    ... Unfortunatly I cant get it right. ... I want to run this macro 6 or 7 times, or loop back to second row and delete ...
    (microsoft.public.excel.misc)
  • Voxel loop optimisation
    ... doing this in a loop, and was wondering if anyone had a ... Imagine a 3x3x3 rubix cube of elements: ... I can select, say, a plane through the 3rd dimension as follows: ... the second row as above? ...
    (comp.soft-sys.matlab)