Real-Time Workshop use Embedded Matlab Function to generate random numbers
이전 댓글 표시
Hi everyone, In the Real Time Workshop I am trying to use in an embedded Matlab function in Stateflow the two function “rand” and “round”, but I always get the following error: Failed to eliminate a use of the MATLAB function 'rand/round'. For non-simulation builds, uses of unsupported MATLAB functions are eliminated if they do not effect the model outputs. The code that I am using is the seguent:
function calculation_one
eml.extrinsic('rand',’round’);
random_number=rand(1,9);
Status_vector_cells= round(0+(99-0).*random_number);
I would like please to know:
-If the two function are in the list of supported Matlab functions for RTW code generation;
-if it is possible to know where can I find the list of supported Matlab functions for RTW, as I have looked long without find it;
-If these two functions are not supported, is there any other way to generate random number through m file? I have tried with the Simulink block “Random Source” or “Random Number”, and the generation code does not give any error, but I would prefer to use some Matlab code that is then implementable inside Stateflow through the embedded Matlab function;
Can somebody help me?
I am using Matlab 2009b 32bit with a multi core PC.
Really Thanks In advance
Andrea
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Simulink Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!