Undefined function or variable
古いコメントを表示
Hello,
I have a matlab file matlab_ode45_h.m:
function y = matlab_ode45_h(h, y0)
[T,Y] = ode45(@matlab_ft, [0 0.5*h h], y0);
y = Y(3,:);
I compile it using matlab compiler into a static library and call the function matlab_ode45_h from c++ code. I'm getting the following:
??? Undefined function or variable "h".
Error in ==> matlab_ode45_h at 4
How may this happen?
Thanks
回答 (1 件)
Walter Roberson
2011 年 6 月 19 日
1 投票
That could happen if you do not pass anything in from C++ when you call matlab_ode45, or if somehow the argument marshaling between C++ and MATLAB is not set up correctly.
What C++ call are you using?
2 件のコメント
Linar
2011 年 6 月 19 日
Kaustubha Govind
2011 年 6 月 20 日
Do you call the MCR and library initialize and terminate functions in the right order? If yes and you still see the issue, could you try the documentation example and see if you can get it to work: http://www.mathworks.com/help/toolbox/compiler/f2-995712.html#f2-1009231
カテゴリ
ヘルプ センター および File Exchange で Deploy to C++ Applications Using mwArray API (C++03) についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!