help-octave
[Top][All Lists]
Advanced

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

vectorisation and cell arrays


From: Bertrand Roessli
Subject: vectorisation and cell arrays
Date: Fri, 27 Mar 2009 12:32:55 +0100

Hello,

Does anybody know if it is possible to vectorize 
matrix operations (the matrices are stored in a cell array) 
on a vector and so to avoid looping over the elements 
of the cell? Thanks in advance

For example

a =

{
  [1,1] =

     1   0   0
     0  -1   0
     0   0   1

  [1,2] =

     1   0   0
    -1   0   0
     0   0  -1

e=[1;2;3];

a{1}*e

ans =

   1
  -1
  -3
works fine, but 
a{:}*e

error: binary operator `*' not implemented for `cs-list' by `matrix'
operations


Bertrand Roessli




reply via email to

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