help-octave
[Top][All Lists]
Advanced

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

Re: Assigning matrices to structures.


From: James Sherman Jr.
Subject: Re: Assigning matrices to structures.
Date: Tue, 6 Oct 2009 12:06:15 -0400

I'm sure that there is a better/more elegant solution, but you could do something like:

B = zeros(1,2);
X = repmat(B, [1 10]);
a = mat2cell(X, 1, 2*ones(1,2));

On Tue, Oct 6, 2009 at 10:47 AM, Rishi Amrit <address@hidden> wrote:
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

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

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