IDL2MATLAB [message #29482] |
Tue, 26 February 2002 05:02  |
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 #29538 is a reply to message #29482] |
Wed, 27 February 2002 14:43   |
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 #29611 is a reply to message #29482] |
Tue, 05 March 2002 07:23  |
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  |
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  |
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  |
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.
|
|
|