Why am I getting an error " Function 'isfixed' is not defined for a first argument of class double." while integrating in a matlab function block in simulink.
1 回表示 (過去 30 日間)
古いコメントを表示
This is the code that I have put in the matlab function block . Its a 2 input 5 output function. I am getting an error "Function 'isfixed' is not defined for a first argument of class double." . Any help is appreciated.
function [x1,x2,theta,v1,v2] = fcn(u1,u2,u3)
%#codegen theta = double(int(u2));
v1=u1*cos(theta);
v2=u1*sin(theta);
x1=double(int(v1,theta));
x2=double(int(v2,theta));
0 件のコメント
回答 (1 件)
Mike Hosea
2012 年 8 月 31 日
I was not even aware of this "int" function. Apparently it is deprecated and you are now supposed to use storedInteger(), or I guess what you need here is, rather, storedIntegerToDouble(). Anyway, the int function is being invoked on inputs that are not fixedpoint numbers. This may be a problem with your model, or it might be an issue related to the automatic determination of signal sizes. If it is the latter, you may be able to avoid the issue by going into the model explorer and specifying explicitly the sizes and types of the inputs u1 and u2 here rather than let these things be inherited.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!