필터 지우기
필터 지우기

Errors occurs while converting the code created using 5G Toolbox's SIB1 Recovery Example to C code using Matlab Coder.

조회 수: 2 (최근 30일)
I am trying to convert the code created using the SIB1 Recovery Example of 5G toolbox into C code through Matlab coder.
However, many errors occurred and were corrected, but the two errors below have not yet been corrected.
First,
rxGrid = nrOFDMDemodulate(rxWaveform_1, nrb, scsCommon, nSlot,'SampleRate',Fs,'CarrierFrequency',fPhaseComp);
Error Message : In code generation, when you specify the 'SampleRate' name-value argument in the nrOFDMDemodulate(WAVEFORM,NRB,SCS,INITIALNSLOT,NAME,VALUE) syntax, the 'SampleRate' and 'Nfft' name-value arguments and the NRB and SCS arguments must be compile-time constants.
If the above syntax is changed as follows, incorrect operation will occur.
rxGrid = nrOFDMDemodulate(rxWaveform_1, nrb, scsCommon, nSlot);
Second,
[sib1bits,sib1CRC] = decodeDLSCH(cw,pdsch.Modulation,pdsch.NumLayers,dci.RedundancyVersion);
Error Message : When generating code, the NLAYERS input must be a constant value.
Can you resolve errors that occur in Matlab Coder?

채택된 답변

Angelo Yeo
Angelo Yeo 2024년 4월 25일
1) This must be a question on compile-time constant of MATLAB Coder. For basic understanding, see coder.Constant Class.
2) For nrOFDMDemodulate, see the "Extended Capabilities" for your information. This function requires some name-value arguments to be compile-time constant for code generation. (It's a MUST!) And this requires you to use -args value of codegen function. Below is a screenshot from the nrOFDMDemodulate doc.
3) For nrDLSCHDecoder, same story applies. See its "Extended Capabilities" section and read usage notes for "nlayers" input. This should be used with -args when using codegen.

추가 답변 (0개)

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by