transpose error, linear system

3 views (last 30 days)
Pavlos
Pavlos on 2 Aug 2013
Hello,
i am trying to solve a problem of Ax=B, I pass my c++ variables to matlab, and then i want to solve the problem and get it back. I have a nXn matrix and to solve the issue of c++ row base with matlab column base i load the transpose matrix like:
engPutVariable(ep, "Am",Am);
engPutVariable(ep, "Bm",Bm);
engPutVariable(ep, "Rm",Rm);
engEvalString (ep, "Am = transpose(Am);");
engEvalString (ep, "Rm = linsolve(Am,Bm);");
Rm = engGetVariable(ep,"Rm");
When i tried an example of 3x3 it computes correctly the 2 of the 3 values an on the third is garbage. Any ideas? Thanks you all.

Answers (0)

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!