Please support our Shell Scripting advertiser: Programming Forums
Views: 1538 | Replies: 0
![]() |
•
•
Join Date: Jul 2005
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I am trying to use Simpson's Law to find the area in some profiles i have and i'd like to do this in a in a shell script as this how the data has been created.
an example of the file ( without the brackets):
(1) (2)
(a) 12.146 -0.65
(b) 12.146 -0.67
(c) 12.147 -0.71
(d) 12.147 -0.78
etc
etc
I need to use this formula:
a2 + 4 *( b2 + c2)
so that i have a third column like:
(1) (2)
(a) 12.146 -0.65 1.59 a2 + 4 *( b2 + c2)
(b) 12.146 -0.67
(c) 12.147 -0.71 -0.43 c2 + 4 *( d2 + e2)
(d) 12.147 -0.78
i know it can be done in matlab- but is there any way of doing this in awk or any other shell programs ?
an example of the file ( without the brackets):
(1) (2)
(a) 12.146 -0.65
(b) 12.146 -0.67
(c) 12.147 -0.71
(d) 12.147 -0.78
etc
etc
I need to use this formula:
a2 + 4 *( b2 + c2)
so that i have a third column like:
(1) (2)
(a) 12.146 -0.65 1.59 a2 + 4 *( b2 + c2)
(b) 12.146 -0.67
(c) 12.147 -0.71 -0.43 c2 + 4 *( d2 + e2)
(d) 12.147 -0.78
i know it can be done in matlab- but is there any way of doing this in awk or any other shell programs ?
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode