octave-maintainers
[Top][All Lists]
Advanced

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

Re: setfields() compatibility question


From: John Frain
Subject: Re: setfields() compatibility question
Date: Mon, 20 Oct 2014 20:04:44 +0100

Output from MATLAB 2014a is below

John


>> x(2,2).a = 1

x =

2x2 struct array with fields:

    a

>> setfield (x, {':', 2}, 'a', 2)
Error using setfield (line 56)
Insufficient outputs from right hand side to satisfy comma separated
list expansion on left hand
side.  Missing [] are the most likely cause.

>> x(:,1).a = 3
Insufficient outputs from right hand side to satisfy comma separated
list expansion on left hand
side.  Missing [] are the most likely cause.

>>
John C Frain, Ph.D.

Economics Department             3 Aranleigh Park
Trinity College Dublin                 Rathfarnham
College Green                           Dublin 14
Dublin 2                                    Ireland
Ireland
www.tcd.ie/Economics/staff/frainj/home.htm
mailto:address@hidden
mailto:address@hidden


On 20 October 2014 19:36, Rik <address@hidden> wrote:
> Can someone test this code snippet in Matlab?
>
> x(2,2).a = 1
> setfield (x, {':', 2}, 'a', 2)
> x(:,1).a = 3
>
> I expect errors out of the third statement, but I'm interested whether the
> setfield command works.
>
> --Rik
>



reply via email to

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