[scilab-Users] Difference between function return value and literal
Mike Page
Mike at Page-One.Waitrose.com
Fri Jul 16 15:01:16 CEST 2010
Hi Peter,
The type of a dimension vector is int32. This shows as an integer type (no
decimal point). You can convert it to double floating if you need to using:
rows=myCell.dims(1);
R=double(rows);
disp(R); // -> 2.
Usually this is not required, but I have found that I had to do exactly this
in order to pass hypermatrix dimensions in to a C function, because the
interface assumes double type.
hth.
Mike.
-----Original Message-----
From: Peter von Niederhaeusern [mailto:pvonnied at gmail.com]
Sent: 16 July 2010 13:18
To: users
Subject: [scilab-Users] Difference between function return value and
literal
Hi all,
This might be a silly question, but I don't get it:
// 1. version
rows=myCell.dims(1);
disp(rows); // -> 2
disp( [1:1:rows] ); // -> 1 2
// 2. version
_rows=2;
disp(_rows); // -> 2.
disp( [1:1:_rows] ); // 1. 2.
What's the difference between the plain values (e.g. 2) of the return value
and the indexed values with dots (e.g. 2.)?
I need to get the second version but dynamically
(as in the first version) assigned (to read out some values from a cell)...
Thx for a hint
Peter
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.830 / Virus Database: 271.1.1/3005 - Release Date: 07/15/10
19:35:00
More information about the users
mailing list