Question on Simulink Matlab Function

조회 수: 3 (최근 30일)
Fumihiko Sato
Fumihiko Sato 2024년 8월 30일
댓글: Fumihiko Sato 2024년 9월 3일
Hello Everyone,
I'd like to ask something about the MATLAB Function in Simulink.
My project is try to use the MATLAB function to create a bitstream of the data (As frame) with variable output size depend on the input.
Here is my question.
1) Possible to set the MATLAB function output as dynamic variable size depend on the output of the function?
Example,
1st frame is generated data size = [200x1], After first frame output size should be 200x1
2nd frame is generated data size = [196x1], After second frame output size should be 196x1
2) The output from MATLAB Function must connect to the DBPSK modulation block (as below diagram)
But I got this error.
Error:Simulink cannot propagate the variable-size mode from the 'Output Port 1' of 'SigfoxTX/DBPSK Modulator Baseband/In1' to the 'Input Port 1' of 'SigfoxTX/DBPSK Modulator Baseband/M-DPSK Modulator Baseband'. This input port expects a fixed-size mode. The variable-size mode originates from 'SigfoxTX/MATLAB Function'. Examine the configurations of 'SigfoxTX/DBPSK Modulator Baseband/M-DPSK Modulator Baseband' for one of the following scenarios: 1) the block does not support variable-size signals; 2) the block supports variable-size signals but needs to be configured for them.
Below is original setting on Model Exploer.
When I uncheked the Variable size, I got this error instead.
Are there any way to fix this issue?
Thank you in advance.
PS. I also attached the simulink model for your reference.
Best Regards,
Fumihiko Sato

채택된 답변

praguna manvi
praguna manvi 2024년 8월 30일
MATLAB Function block supports variable-size arrays for input and output types, it can be configured in Model Explorer, you can know refer more about its block properties here:
However, DBPSK Modulator Baseband doesn’t support variable-sized arrays you can confirm it view the supported data types by running:
showcommblockdatatypetable
A possible workaround fix to resolve this issue is to either truncate or pad the output of the MATLAB Function block to a fixed size.

추가 답변 (1개)

Aravind
Aravind 2024년 8월 30일
The “DBPSK modulator” block in Simulink, does not support variable-size input signals. Hence, you are receiving an error regarding this, when your “MATLAB function” block is outputting a variable-size signal. More information on which Simulink blocks in the Communications Toolbox support variable-size signals, run the “showcommblockdatatypetablefunction from the MATLAB Command line.

카테고리

Help CenterFile Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by