stateflow_average

Hi, Can any one help me on this, I have variable count, which is input to stateflow, i need to calculate the average of 3 values inside the stateflow, and stateflow is triggring at every 1sec. guide me how to do it.
Thanks in advance for your help.

답변 (1개)

Wilfred
Wilfred 2011년 9월 14일

0 개 추천

You can use the Matlab mean function in a stateflow action. If your 3 values are x, y and z, then it would be something like
/A=[x y z]; average=ml('mean(A)');
with x, y and z input data to Stateflow and A a local variable with size 3.

카테고리

도움말 센터File Exchange에서 Decision Logic에 대해 자세히 알아보기

제품

태그

질문:

2011년 6월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by