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

Home » Public Forums » archive » simple questions: position and strings
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: Simple questions [message #2841 is a reply to message #809] Mon, 26 September 1994 11:06 Go to previous messageGo to previous message
amaravad is currently offline  amaravad
Messages: 11
Registered: September 1994
Junior Member
In article <1994Sep23.213634.20939@mksol.dseg.ti.com> mcook@mksol.dseg.ti.com (mark k cook) writes:
> I have a couple of recurrent problems with IDL that I was
> hoping somebody could set me straight on. I seem to be
> getting into a situation where I'll ask for a calculation
> and the variable will be represented as an array instead
> of a scalar. This causes some of the IDL routines to die.
> I'm not sure where in the code this occurs at, but can't
> IDL just take the single element value as the scalar?
> A 1-dim vector should be treated as a scalar. Since
> there is no way I can figure out where something becomes
> a vector rather than a scalar in my operations, does this
> mean I have to write extra code to handle conversions?
> How do I know what or where to write it? This would be
> ludicrous, so I must be wrong somewhere.

if result is the name of the variable that you are expecting
to be returned as a scalar, but are finding that result is a
1-D array of length one instead, then just include
result=result(0)
at the end of your code. Result will be a scalar.

>
> The other recurrent problem is an out-of-space (memory)
> problem. How can I clear away any matrices I don't want
> around anymore to free up space?

Once you no longer need the matrix, just set matrix=0
This will automatically reset the matrix to a scalar
and release all additional space to the OS.
This will help you conserve memory.

>
> There are some things I like that IDL has over MATLAB
> (more than 2 D), but these two are no problem with MATLAB.
> It's gotta be my understanding of IDL.
>
> Thanks,
> Mark Cook
> mcook@lobby.ti.com

Hope this helps...

ratnakar amaravadi
ratty@foyt.indyrad.iupui.edu
--
This is my .sig file and not yours...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: 941005.news-idlusers-gateway
Next Topic: CW_PDMENU enhancement

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

Current Time: Sat Nov 29 03:08:20 PST 2025

Total time taken to generate the page: 0.15807 seconds