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

Home » Public Forums » archive » Re: "Expression Must be a Scalar in this context:" error in nlinlsq function
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: "Expression Must be a Scalar in this context:" error in nlinlsq function [message #81233 is a reply to message #81221] Tue, 28 August 2012 09:37 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
elambrid writes:

> Yes I agree, so I guess what I'm confused about is nlinlsq works like a for loop where the iterations are determined by the amounts of "functions", better word would be the size of you data set. So I have all these variables that look like this e.g a=[b(0)...b(n)] How would I check if one of those values are zero, and perform a statement on them? And thank you for your speedy reply!

If you want to check an individual element, you
have to check an individual element!

variable = [0, 1, 1, 0, 4]
FOR j=0,N_Elements(variable)-1 DO BEGIN
IF variable[j] EQ 0 THEN Print, 'variable ' + StrTrim(j,2) + $
' is equal to zero' ELSE Print, 'Good value'
ENDFOR

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Format code to trim leading zeroes?
Next Topic: Re: Inheriting Properties (or something similar) in IDLDOC

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

Current Time: Wed Oct 08 19:10:51 PDT 2025

Total time taken to generate the page: 0.00461 seconds