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

Home » Public Forums » archive » IDL2MATLAB
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
IDL2MATLAB [message #29482] Tue, 26 February 2002 05:02 Go to next message
the_cacc is currently offline  the_cacc
Messages: 104
Registered: October 2001
Senior Member
A long shot: is there an IDL to MATLAB source code translator out there ?
Re: IDL2MATLAB [message #29533 is a reply to message #29482] Wed, 27 February 2002 16:35 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.16e7141c7c2e3855989825@news.frii.com...

> Liam E. Gumley (Liam.Gumley@ssec.wisc.edu) writes:
>
>> The term "column-major" is used because the column index varies the
>> fastest when accessing contiguous elements of a multi-dimensional
>> array in memory.
>

> This is also known as "row-order", for those of you who love
> confusion. :-)

I think the terms "column" and "row" should be banned in reference to
arrays.

---
Mark Hadfield
m.hadfield@niwa.co.nz http://katipo.niwa.co.nz/~hadfield
National Institute for Water and Atmospheric Research
Re: IDL2MATLAB [message #29537 is a reply to message #29482] Wed, 27 February 2002 15:05 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Liam E. Gumley (Liam.Gumley@ssec.wisc.edu) writes:

> The term "column-major" is used because the column index varies the
> fastest when accessing contiguous elements of a multi-dimensional array
> in memory.

This is also known as "row-order", for those of you
who love confusion. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: IDL2MATLAB [message #29538 is a reply to message #29482] Wed, 27 February 2002 14:43 Go to previous messageGo to next message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Nigel Wade wrote:
> Liam E. Gumley wrote:
>
>> Ethan wrote:
>>>
>>
>>
>> A complicating factor is that in IDL, arrays are stored in column-major
>> order (the same as FORTRAN), while in Matlab, arrays are stored in
>> row-major order (the same as C).
>
> Substitute IDL for MATLAB. In IDL they are the same as in C. I can never
> remember which is column-major or row-major, but I know that using MATLAB
> multi-dimension matrices in C mex files is a real pain because of the array
> indexing difference.

I'll stick by my original comments, which referred to *arrays* only (not
matrices). In IDL and FORTRAN, an array with dimensions [m cols, n rows]
is stored contiguously in memory as

(col 1, row 1), (col 2, row 1), (col 3, row 1), ... (col m, row 1),
(col 1, row 2), (col 2, row 2), (col 3, row 2), ... (col m, row 2),
(col 1, row 3), (col 2, row 3), (col 3, row 3), ... (col m, row 3),
.
.
.
(col 1, row n), (col 2, row n), (col 3, row n), ... (col m, row n)

The term "column-major" is used because the column index varies the
fastest when accessing contiguous elements of a multi-dimensional array
in memory.

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: IDL2MATLAB [message #29553 is a reply to message #29482] Wed, 27 February 2002 07:22 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
William Thompson (thompson@orpheus.nascom.nasa.gov) writes:

> Oh no, not the row-major, column-major controversy again! ;^)

I've written up the er... definitive article on the subject,
for those newcomers who haven't yet enjoyed the experience.
You can find it here:

http://www.dfanning.com/misc_tips/colrow_major.html

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: IDL2MATLAB [message #29554 is a reply to message #29482] Wed, 27 February 2002 07:09 Go to previous messageGo to next message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Nigel Wade <nmw@ion.le.ac.uk> writes:

> Liam E. Gumley wrote:

>> Ethan wrote:
>>>
>>
>>
>> A complicating factor is that in IDL, arrays are stored in column-major
>> order (the same as FORTRAN), while in Matlab, arrays are stored in
>> row-major order (the same as C).

> Substitute IDL for MATLAB. In IDL they are the same as in C. I can never
> remember which is column-major or row-major, but I know that using MATLAB
> multi-dimension matrices in C mex files is a real pain because of the array
> indexing difference.

Oh no, not the row-major, column-major controversy again! ;^)

Bill Thompson
Re: IDL2MATLAB [message #29611 is a reply to message #29482] Tue, 05 March 2002 07:23 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
There was an episode with bart as an old man - so that proves the model can
cope with "Transpose"


"Ethan" <gutmann@colorado.edu> wrote in message
news:3de2e497.0202281507.36338326@posting.google.com...
> David Fanning <david@dfanning.com> wrote in message
news:<MPG.16e805caaf762e90989828@news.frii.com>...
>
>> I would suggest "homer" and "bart", in an attempt to
>> get the younger members of our group more involved.
>>
>
> :)
>
> Hmmm, would this leave marge, lisa, and maggie for the 3rd,4th,5th
> dimensions? Even though to the best of my knowledge Homer is the only
> one who as ever actually been to the third dimension...
Re: IDL2MATLAB [message #29648 is a reply to message #29482] Thu, 28 February 2002 15:07 Go to previous message
gutmann is currently offline  gutmann
Messages: 11
Registered: December 2001
Junior Member
David Fanning <david@dfanning.com> wrote in message news:<MPG.16e805caaf762e90989828@news.frii.com>...

> I would suggest "homer" and "bart", in an attempt to
> get the younger members of our group more involved.
>

:)

Hmmm, would this leave marge, lisa, and maggie for the 3rd,4th,5th
dimensions? Even though to the best of my knowledge Homer is the only
one who as ever actually been to the third dimension...
Re: IDL2MATLAB [message #29661 is a reply to message #29482] Thu, 28 February 2002 08:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
James Kuyper (kuyper@gscmail.gsfc.nasa.gov) writes:

> What would you substitute in their place? "first dimension" and "second
> dimension", while less ambiguous, are a lot clumsier.

I would suggest "homer" and "bart", in an attempt to
get the younger members of our group more involved.

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: IDL2MATLAB [message #29662 is a reply to message #29533] Thu, 28 February 2002 08:00 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Mark Hadfield wrote:
...

> I think the terms "column" and "row" should be banned in reference to
> arrays.

What would you substitute in their place? "first dimension" and "second
dimension", while less ambiguous, are a lot clumsier.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Odd behavior of Device, cursor_image
Next Topic: array of structure changed from 5.4 to 5.5?

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

Current Time: Wed Oct 08 11:43:58 PDT 2025

Total time taken to generate the page: 0.00779 seconds