transpose error, linear system

3 次查看(过去 30 天)
Pavlos
Pavlos 2013-8-2
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 C Shared Library Integration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by