Cell array feature request.

John W. Eaton jwe at octave.org
Tue Jun 9 13:45:11 CDT 2009


On  9-Jun-2009, pascal.pype at b-holding.be wrote:

| First of all, this is not really a bug report but a feature request.
| Becuase we don't know where to send feature requests, we
| send it to 'bug at octave.org' nonetheless.
| 
| Consider the following code:
| 
| cellA = cell(2,2);
| cellA(1,1) = 'Peep said the mouse in the birdy house.';
| cellA(1,2) = rand(3,4);
| cellA(2,2) = 3.14;
| 
| cellB = cell(2,2);
| cellB(1,1) = 'The fox is jumping over the lazy dog.';
| cellB(1,2) = 12;
| cellB(2,1) = rand(3,5);
| cellB(2,2) = struct('a',2,'b',4);
| 
| cellA(2,1) = cellB;
| This gives rise to the following error message:
| 
| error: A(I, J) = X: X must be a scalar or the number of elements in I must
| error: match the number of rows in X and the number of elements in J must
| error: match the number of columns in X
| error: assignment failed, or no method for `cell = cell'
| error: evaluating assignment expression near line 75, column 12
| 
| Shouldn't it be possible to assign cell arrays towards cells in
| circumventing cell arrays ? In other words: Should there be a method
| within the octave classes that treats the case: `cell = cell' ?

This is not a bug.

If you want to assign a cell into a single cell of another cell array,
you need to write something like

  cellA{2,1} = cellB;

jwe


More information about the Bug-octave mailing list