Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mysterious failure of simple statement

16 views
Skip to first unread message

E. Rietsch

unread,
Feb 10, 2012, 5:03:05 PM2/10/12
to
Hi,

The following three-line script

c=[1 0];

P=[0.01 0.02 ; 0.02 0.04];

K = c*P*c’;

fails with the message

K = c*P*c' ?; !--error 10
Inconsistent multiplication.

I am running Scilab 5.2
Does anyone know what the problem is?

Cheers,
E. Rietsch

Helmut Sennewald

unread,
Feb 11, 2012, 2:06:53 AM2/11/12
to
Hello E.,

I tried with Scilab-5.3.3 on WIN-XP 32bit.
It worked without any problem.

->K
K =

0.01

Best regards,
Helmut


Francois Vogel

unread,
Feb 11, 2012, 3:31:33 AM2/11/12
to
E. Rietsch said on 10/02/2012 23:03:
>
> K = c*P*c’;

What kind of apostrophe are you using here to transpose the c vector?

This will work with K = c*P*c'

F.

E. Rietsch

unread,
Feb 11, 2012, 8:45:59 AM2/11/12
to
I use the standard apostrophe (not the "back" apostrophe).
I run Windows 7 (32 bit) and tried it with Scilab 5.2.1, Scilab 5.2.2,
and Scilab 5.3.1

Incidentally, the computation works if I break it into two statements:

a=c*P;
K=a*c';

Jean-Pierre Vial

unread,
Feb 11, 2012, 9:20:41 AM2/11/12
to
Le 11/02/2012 14:45, E. Rietsch a écrit :
> I use the standard apostrophe (not the "back" apostrophe).
> I run Windows 7 (32 bit) and tried it with Scilab 5.2.1, Scilab 5.2.2,
> and Scilab 5.3.1
>

in your first message
the first apostrophe is ascii 7E (hexadecimal, 126 decimal)

in the error message, if you look closely, you will see that the design
and spacing is slightly different: this apostrophe is ascii 27
(hexadecimal, 39 decimal) this is the ordinary ascii apostrophe.

If you copy and paste the K=c*P*c' from the error message, it
will probably work (it does for me, on Linux)

scicoslab has no problem with the original formula (on linux)

E. Rietsch

unread,
Feb 11, 2012, 5:15:43 PM2/11/12
to
Good eyes. You nailed the problem.

This problem was actually passed on to me by a friend, and I copied the
relevant parts of the code to reduce it to as few statements as
possible. I missed the different apostrophe.

Thank you very much.
0 new messages