in reply to I need a liddle piddle advice

I'm assuming you want a PDL with the value of  sqrt( 1/( 0.5 + 0.02*$x**2 )*cos($x) + 1/( 0.5 + 0.02*$y**2 )*cos($y) ) for x and y intervals of 0 to 10, stepping by 1.

The closest thing I've seen is things similar to the example in the synopsis of PDL::Graphics::TriD::Contours.

Here is a lightly modified version with your function:
use PDL; use strict; use warnings; use constant X_NPOINTS => 11; use constant Y_NPOINTS => 11; my $proto = zeroes( X_NPOINTS, Y_NPOINTS ); my $x = $proto->xvals; my $y = $proto->yvals; my $z = sqrt( 1/(0.5 + 0.02*$x**2)*cos($x) + 1/(0.5 + 0.02*$y**2)*cos($y) );
Update: Fixed broken link

Replies are listed 'Best First'.
Re^2: I need a liddle piddle advice
by GrandFather (Saint) on Oct 14, 2008 at 09:53 UTC

    Excellent, that makes sense. Thank you. There is a small error in your implementation of my sample function. It should be:

    my $z = sqrt( (1/(0.5 + 0.02*$x**2)*cos($x))**2 + (1/(0.5 + 0.02*$y**2)*cos($y))**2 );

    But the illustration of the technique was the important thing!


    Perl reduces RSI - it saves typing