Vary the Random number sampling time when it control over digital clock (built in Block) with different sampling time inside Embedded MATLAB function?

조회 수: 2 (최근 30일)
My code is (inside embedded MATLAB function)
function y=example(t)
y=rand(1,1)*t;
t is digital clock input (simulation block) with sampling time (1/1e6) the y also generate random number(uniform distribution) in 1/1e6 sampling time. But I need the sampling time output 'y' should be in (1/1e3) time.
How can i do it?

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2014년 8월 29일
Depending on what you want, you can either set the sample-time of the MATLAB Function block to be 1e-3 as described in this answer, or simply insert a Rate Transition block after the MATLAB Function block, and set its Output port sample time to 1e-3.

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by