필터 지우기
필터 지우기

create changing size array simulink

조회 수: 7 (최근 30일)
mike
mike 2018년 3월 11일
답변: Prajit T R 2018년 3월 14일
the value of signal m with counter Counter Free-Running go to simulink function' the function should be like:
function y = fcn(n,m)
y(n)=m;
the size of y should be change at each time step.
How can I achieve this ?? I getting an error.
%

답변 (1개)

Prajit T R
Prajit T R 2018년 3월 14일
Hi Mike, The error occurs because for code generation in Simulink, you have to define the array 'y' before indexing or sub-scripting it as 'y(n)'. The same function works in MATLAB but not in Simulink. So you would have to pre-define the array y using the zeros function as per the length of the data you are using.
Could you specify the exact nature of the output that you desire? As per the circuit above, it seems to me that the variable m will be passed on to the output as it is. In such a case, there is no need for the above function block. In case you wish to obtain a shifted version of 'm', you can use the delay block instead.
Cheers

카테고리

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