Question: Maple toolbox for Matlab does not work properly

Hi,

So I followed the exact example as in the Maple help for "Matlab[evalM]" which is reproduced below (with my result, which is nearly identical to that in the help example)

> with(Matlab);
> maplematrix_a := Matrix([[3, 3, 2], [4, 5, 2], [6, 2, 4]]);
                        
> maplematrix_b := Matrix([[3, 2, 5], [1, 8, 2], [7, 3, 4]]);
                         
> Matlab[setvar]("matlabmatrix_a", maplematrix_a);
> Matlab[setvar]("matlabmatrix_b", maplematrix_b);


> Matlab[evalM]("c=inv(matlabmatrix_b)*matlabmatrix_a'");


> Matlab[getvar]("c");
                        
[[-0.161676646706586880,-0.401197604790419216,-0.155688622754491135],[0.245508982035928164,0.461077844311377216,-0.0598802395209581256],[0.598802395209580895,0.856287425149700687,1.31736526946107801]]

The problem is is that 'c' is not correct.

even more alarming is when I add the two matrices

> Matlab[evalM]("e=matlabmatrix_b+matlabmatrix_a'");
> Matlab[getvar]("e");
 

[6,6,11; 4, 13, 4; 9, 5, 8]

The results for c and e are not correct.

One can check this easily in Matlab

>> A

A =

     3     3     2
     4     5     2
     6     2     4

>> B

B =

     3     2     5
     1     8     2
     7     3     4

>> C=B\A

C =

   0.658682634730539  -0.245508982035928   0.467065868263473
   0.407185628742515   0.520958083832335   0.179640718562874
   0.041916167664671   0.538922155688623   0.047904191616766

>> C=inv(B)*A

C =

   0.658682634730539  -0.245508982035928   0.467065868263473
   0.407185628742515   0.520958083832335   0.179640718562874
   0.041916167664671   0.538922155688623   0.047904191616767

>> E=B+A

E =

     6     5     7
     5    13     4
    13     5     8

I am using Maple 13.02 and Matlab 2009 B with the maple toolbox for matlab on windows 7 64 bit machine.

Clearly the interface is not working properly and even shown to be the case in Maple's own help file.

 

Please Wait...