[問題] Embedded Matlab Function in Simulink已回收
Hallo 各位前輩
不知道大家有沒有在simulink用Embedded matlab function 解聯立方程式的經驗
程式碼如下
function output = fcn(a,b)
x=0;y=0;
eml.extrinsic('num2str', 'solve');
x=num2str(x);
y=num2str(y);
[x,y]=solve('3*x + 4*y =5', '2*x+7*y=8');
double(x);
output = x;
因為syms x, y 無法直接在simulink中使用
錯誤訊息如下: Command-duality is not supported.
所以我改用num2str 的方法
但出現新的錯誤
Embedded MATLAB Interface Error: Class of MATLAB expression 'num2str'
is char; expected double. Block Embedded MATLAB Function
爬過很多文和google都沒有找到解決的方法
不知道有沒有人有類似的經驗可以分享
非常感謝!
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 129.13.72.197
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章