transpose error, linear system

3 Ansichten (letzte 30 Tage)
Pavlos
Pavlos am 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.

Antworten (0)

Kategorien

Mehr zu C Shared Library Integration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by