[Top][All Lists]

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

Operator * and int32 matrix and matrix

From: Tim Gollnik
Subject: Operator * and int32 matrix and matrix
Date: Fri, 14 Jul 2006 22:30:21 +0200
User-agent: KMail/1.9.3


I have a problem and I don't know what I can expect of octave. If I load an 
HDF5 file written by a mesoscale weather model, I get structures like this: 

octave:28> k
k =
  dx =     200
  dy =     200
  dz =     10
  nx = 1
  ny = 121
  nz = 201
  x0 =     10500
  y0 =     1500
  z0 =     0

k.dx and k.x0 are real values (floating point numbers), stored as double 
matrices, k.nx is an integer value, stored as int32 matrix in octave.

If I multiply for example k.dy by k.ny I get this:

octave:29> k.dy * k.ny
error: binary operator `*' not implemented for `matrix' by `int32 matrix' 
error: evaluating binary operator `*' near line 29, column 6

I would expect 24200 as in

octave:29> k.dy * double(k.ny)
ans =  24200

But even if k.ny wouldn't be stored as a matrix I would expect something like 
3.4 * int32(2) would give 6.8 instead of 7.

Am I wrong?

Thank You


Attachment: pgpjmLMdZxAJp.pgp
Description: PGP signature

reply via email to

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