help-octave
[Top][All Lists]
Advanced

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

RE: Assigning matrices to structures.


From: Bård Skaflestad
Subject: RE: Assigning matrices to structures.
Date: Tue, 6 Oct 2009 18:12:26 +0200

Hi,

You can use regular indexing on the array you're assigning to and explict CELL 
creation of the assigned value.  For instance

    a(1:10) = {zeros(1,2)};

For much more on the semantics of this and related issues I recommend Loren 
Shure's (of The MathWorks) blog entry

    http://blogs.mathworks.com/loren/2008/01/24/deal-or-no-deal/


Best regards,
-- 
Bård Skaflestad
SINTEF ICT, Applied Mathematics.

________________________________________
From: Rishi Amrit address@hidden
Sent: 06 October 2009 16:47
To: help-octave
Subject: Assigning matrices to structures.

Hi,

   The following statement:

a{1:10} = zeros(1,2)

used to work until version 3.0.5. It does not work from 3.2 onwards. Any 
suggestions on how to change the code to make it work with the new versions of 
Octave ? I dont want to add for loops.

Thanks,

Rishi



reply via email to

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