help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help on assignment in struct arrays


From: Eric Chassande-Mottin
Subject: help on assignment in struct arrays
Date: Fri, 10 Sep 2010 04:56:59 -0700 (PDT)


hi,

I'd like to replace all occurence of "~" by NaN in a struct array.
here is an example:

> a(1).a=1; a(1).b=2; a(2).a="~"; a(2).b=3; a(3).a="~"; a(3).b=4;
> idx=find([a.a]=="~")
idx =

   2   3

I'm able to find the "~" but don't know how to do the assignment:
> [a(idx).a]=nan
error: some elements undefined in return list
>[a.a](idx)=nan
error: invalid lvalue function called in expression

could anybody please help?

thanks,
eric
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/help-on-assignment-in-struct-arrays-tp2534285p2534285.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]