Subscripting into an mxArray is not supported. Cell contents reference from a non-cell array object.

조회 수: 1 (최근 30일)
I have a Simulink model, there is a MATLAB function CodeBlockSegment. In this function I call the lteCodeBlockSegment function (from LTE Toolbox), which returns the result as a cell array with int8 column vector elements (the size of the vectors changes depending on the input data). I need to get separately each vector that is a subset of the cell array.
I have already tried all possible solutions to the problem from the Internet, but I constantly get various errors. That being said, the same code runs well in a simple matlab .m file.
function segm = CodeBlockSegment(in,num)
coder.extrinsic('lteCodeBlockSegment','cell2mat','cell2table');
cbs1 = lteCodeBlockSegment(in);
tf = iscell(cbs1);%result - 1 ( returns 1 (true) if A is a cell array. Otherwise, it returns 0 (false).)
segm=cbs1{1}; %Cell contents reference from a non-cell array object.
%d = cell2mat(cbs1);
%segm=d(1,1); %Subscripting into an mxArray is not supported.

답변 (1개)

Suman
Suman 2024년 9월 27일
Hi Añ An,
The error "Cell contents reference from a non-cell array object." means that the variable "cbs1" is not a cell array. Try using parentheses instead, "cbs1(1)".

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by