Re: power of a parameter

From: Joseph Zambon <jbzambon_at_nyahnyahspammersnyahnyah>
Date: Thu, 13 Aug 2009 00:25:48 -0400

Exponents of variables are easily solved using:
x^2 or x^3

See: http://www.ncl.ucar.edu/Document/Language/algebraic.shtml

Example...

ncl 19> a = 5
ncl 20> b = a^2
ncl 21> c = a^3
ncl 22> print(a)

Variable: a
Type: integer
Total Size: 4 bytes
             1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 5
ncl 23> print(b)

Variable: b
Type: float
Total Size: 4 bytes
             1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 25
ncl 24> print(c)

Variable: c
Type: float
Total Size: 4 bytes
             1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 125

Hope this helps!

-Joe

Joseph B. Zambon
jbzambon_at_ncsu.edu
NC State University
Department of Marine, Earth and Atmospheric Sciences
Jordan 4133

On Aug 13, 2009, at 12:14 AM, Sahana Paul wrote:

> Dear Madam,
> I want to write an algebric expression in
> NCL script, say square of x , or cube of x. Is there any option to
> denote the algebric expression of power of a quatity or I just have
> to multiply the quatity twice of thrice. I dont find it in language
> manual. Can you please inform me what kind of sign will be
> appropriate to write all these kind of expression.
>
> with regards,
>
> Sahana Paul,
> Post Doctoral Research Associate,
> National Taiwan University,
> Taiwan
>
> Send free SMS to your Friends on Mobile from your Yahoo! Messenger.
> Download Now!http://messenger.yahoo.com/download.php_______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Aug 12 2009 - 22:25:48 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 13 2009 - 14:45:53 MDT