[Top][All Lists]

[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)


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
error: invalid lvalue function called in expression

could anybody please help?

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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