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

Home » Public Forums » archive » Re: matrix division
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: matrix division [message #60435 is a reply to message #60434] Thu, 22 May 2008 01:07 Go to previous messageGo to previous message
adam.ranson is currently offline  adam.ranson
Messages: 4
Registered: May 2008
Junior Member
Thanks for the quick response David! This is the way I'd
assumed it would be done but doesn't give me the numbers
back I'd expect. For example:

I = [[1, 2, 2],[2,1,1]]
C = [[8, 2, 8],[2,8,1]]
Z = I/C

IDL> print, z gives...
0 1 0
1 0 1

I want to divide 1 by 8, 2 by 2, 2 by 8, 2 by 2, 1 by 8 & 1 by 1.

Thanks again

Adam

On 21 May, 19:35, David Fanning <n...@dfanning.com> wrote:
> adam.ran...@bris.ac.uk writes:
>> I have a question about IDL 5.6 which I'm pretty new to... I seem to
>> remember having a similar problem in MatLab a while back too. I'm
>> trying to divide each of the elements in a 2D array by the elements in
>> 2nd 2D array of identical dimensions and put the result into 3rd
>> array. Is it possible to do this in one statement in IDL or do I have
>> to go through each item using a loop?
>
> I would try something like this:
>
> IDL> c = a / b
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: plotting graphics for web pages
Next Topic: Re: interact with iimage from the command line?

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

Current Time: Sat Nov 29 01:51:27 PST 2025

Total time taken to generate the page: 0.71657 seconds