Henry <zemp@itp.unibe.ch> wrote in message <d561906c-62a3-4884-93c8-07721039c078@k8g2000yqn.googlegroups.com>...
> Is there a quicker way to do this?
>
> for iStruct = 1:length(myStruct)
> myStruct(iStruct).field = 'New Value';
> end
[myStruct(iStruct).field] = deal('New Value')
Bruno
Subject: How to change value of field in a array of structures
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gsd9td$g4b$1@fred.mathworks.com>...
> Henry <zemp@itp.unibe.ch> wrote in message <d561906c-62a3-4884-93c8-07721039c078@k8g2000yqn.googlegroups.com>...
> > Is there a quicker way to do this?
> >
> > for iStruct = 1:length(myStruct)
> > myStruct(iStruct).field = 'New Value';
> > end
>
> [myStruct(iStruct).field] = deal('New Value')
>
> Bruno
I think you meant
[myStruct.field] = deal('New Value')
jiro
Subject: How to change value of field in a array of structures