help-octave
[Top][All Lists]
Advanced

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

Re: How to prevent "error: A(I, J) = X: X must be a scalar..." with work


From: Przemek Klosowski
Subject: Re: How to prevent "error: A(I, J) = X: X must be a scalar..." with working matlab code
Date: Tue, 31 Jul 2007 17:33:36 -0400 (EDT)

   I am not interested in adding another special case to the indexed
   array assignment code and after all these years I still don't
   understand precisely what the rules are for matching up dimensions
   with colon indices when the array on the left hand side is undefined
   prior to the assignment.  If someone can clearly explain what the
   rules are, maybe Octave could be compatible.  Does anyone know of
   documentation for this Matlab feature, or is it just something that
   people come to understand in some sort of mystical way?

FWIW, in Matlab 6.5.1

P=12
u= linspace(0,1,P)
x1(:,1)= 0.5.*(u)-0.5
???  In an assignment  A(:,matrix) = B, the number of elements in the subscript 
of A and the number
of columns in B must be the same.

so 'working Matlab code' doesn't even always work in Matlab.


reply via email to

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