help-octave
[Top][All Lists]
Advanced

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

Re: cell{1:5}=1 not working for me!!!


From: Francesco Potortì
Subject: Re: cell{1:5}=1 not working for me!!!
Date: Fri, 01 Jun 2012 15:18:42 +0200

>> Interestingly, global vectors must also be initialized first
>> and then set:
>>
>>  global v(1:6)=9    % this will fail
>>
>> global v2
>> v2(1:5)=7       % this will work
>
>I'm not exactly sure what your plan is, but you can do something like
>
>    global c = num2cell(repmat(1,5,7));

What the original poster said does not refer to cells.  He said that you
can initialise a vector, but not a global vector, at least using the
simple syntax he mentions.  In fact:

octave> v1(1:3)=2
v1 =
   2   2   2
octave> global v2(1:3)=2
parse error:

  syntax error

>>> global v2(1:3)=2
             ^

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.315.3058 (op.2111)
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Fax:    +39.050.315.2040  
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it


reply via email to

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