From help-octave-request at bevo dot che dot wisc dot edu Wed Feb 4 06:59:45 2004 Subject: Re: subscripted assignment dimension mismatch (NDArray) From: Taku J SATO To: Nathan Weisz Cc: Octave_post Date: Wed, 4 Feb 2004 21:56:43 +0900 Hi Nathans, thanks for your quick reply. perhaps, my example was not good. what i want to do is as follows: ----- octave:1> test = zeros(4,4,2) octave:2> test2 = [1,2]' octave:3> test(1:2,1,1) = test2 error: subscripted assignment dimension mismatch error: assignment failed, or no method for `matrix = matrix' error: evaluating assignment expression near line 3, column 15 ------ actually, i am playing with much bigger arrays (such as 5D array assigned by 2D matrix.) the above is the simplest case i could reproduce the problem. (i am presently writing a program which produces all the irreducible representations of the k-groups of the crystallographic space groups. this program seems running on octave-2.1.52 but fails under 2.1.53...) all the best, taku On Feb 4, 2004, at 21:42, Nathan Weisz wrote: > Hi taku, > > is this what you wanted to do? > > octave:42> test = zeros(4,4,2); > octave:43> test(1:2,1,1) = ones(1) > test = > > ans(:,:,1) = > > 1 0 0 0 > 1 0 0 0 > 0 0 0 0 > 0 0 0 0 > > ans(:,:,2) = > > 0 0 0 0 > 0 0 0 0 > 0 0 0 0 > 0 0 0 0 > > HTH, > Nathan > > Am 04.02.2004 um 13:31 schrieb Taku J SATO: > >> Hi, All, >> >> I have just now encountered one problem using octave-2.1.53: >> >> ----- >> octave:1> test = zeros(4,4,2); >> octave:2> test(1:2,1,1) = ones(2,1) >> error: subscripted assignment dimension mismatch >> error: assignment failed, or no method for `matrix = matrix' >> error: evaluating assignment expression near line 2, column 15 >> ----- >> >> This partial assignment of NDArray by a matrix was possible with >> octave-2.1.52. Does anyone know how to overcome it? >> >> all the best, >> taku >> >> -- >> Taku J Sato >> National Institute for Materials Science, >> 1-2-1 Sengen, Tsukuba, Ibaraki 305-0047, Japan >> >> >> >> ------------------------------------------------------------- >> Octave is freely available under the terms of the GNU GPL. >> >> Octave's home on the web: http://www.octave.org >> How to fund new projects: http://www.octave.org/funding.html >> Subscription information: http://www.octave.org/archive.html >> ------------------------------------------------------------- >> > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > > > -- Taku J Sato National Institute for Materials Science, Tsukuba, Ibaraki 305-0047, Japan ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------