comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » BEGINNER ASKS FOR HELP!!!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
BEGINNER ASKS FOR HELP!!! [message #10945] Fri, 30 January 1998 00:00
Edoardo \"Dado\& is currently offline  Edoardo \"Dado\&
Messages: 1
Registered: January 1998
Junior Member
Dear Sirs,

I've just started using IDL 5 and I would like to solve this problem I've
encountered.

I need to create a RANDOM square matrix that contains only three numbers 0,
1, and (-1). There are two constraints though. I would like to tell the
program before it creates this matrix what the (at least approximate) RATIO
of 1 / (-1) should be and HOW MANY (at least approximately) 1 and (-1)
(total) are on each row of the matrix.

For example, the input by the user would be:

NUMBER OF ELEMENTS PER ROW e.g., 6

RATIO OF 1 / (-1) e.g., 0.5 (at the level of the matrix not of the row)

NUMBER OF 1 AND (-1) (total) IN EACH ROW e.g., 3 (for example 0 0 0 1 1 -1)

I do not need the ratio and number of |1| per row to be exact, also an
approximation it's good.

Thanx for your help,

Dado
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Table Widget
Next Topic: Re: Switching back to BW in postscript

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 12:08:27 PDT 2025

Total time taken to generate the page: 0.08219 seconds