Round function with multiple inputs not working in MATLAB function block in Simulink -


i want round number 3 decimal places. in matlab can in way:

>> number=25.0001; >> round(25.0001,3)  ans =  25 

if try in simulink in matlab function block in way:

function d_avg1 = fcn(m) %#codegen  d_avg1 = round(m,3); 

it gives error:

error calling 'round'. call-site passes more inputs function can accept. function 'bsd_system /averaging/matlab function' (#278.45.55), line 4, column 10: "round(m,3)" component: matlab function | category: coder error 

matlab function block supports syntax 1 input round function. see documentation list of functions @ http://www.mathworks.com/help/coder/ug/functions-supported-for-code-generation--alphabetical-list.html against round function see "supports syntax y = round(x)."

as smyslov mentions need make extrinsic if need syntax. extrinsic works simulation. embedded code generation extrinsic functions not generate code.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -