i want to make MATLAB function in Simulink to read one cell from excel sheet every period of time after run this code give me that error Brace indexing is not supported for v
function object = readFromXls(ReadFlag)
coder.extrinsic(‘readcell’);
coder.extrinsic(‘str2num’);
coder.extrinsic(‘cellfun’);
coder.extrinsic(‘cell2mat’);
data = 0;
object = 0;
if ReadFlag == 1
excelFilePath = ‘YOLO_Object_Type.xlsx’;
% Read data from the Excel file
data = cell2mat(excelFilePath);
%iwant = cellfun(@cell2mat,data)
object = data;
else
object =0;
endfunction object = readFromXls(ReadFlag)
coder.extrinsic(‘readcell’);
coder.extrinsic(‘str2num’);
coder.extrinsic(‘cellfun’);
coder.extrinsic(‘cell2mat’);
data = 0;
object = 0;
if ReadFlag == 1
excelFilePath = ‘YOLO_Object_Type.xlsx’;
% Read data from the Excel file
data = cell2mat(excelFilePath);
%iwant = cellfun(@cell2mat,data)
object = data;
else
object =0;
end function object = readFromXls(ReadFlag)
coder.extrinsic(‘readcell’);
coder.extrinsic(‘str2num’);
coder.extrinsic(‘cellfun’);
coder.extrinsic(‘cell2mat’);
data = 0;
object = 0;
if ReadFlag == 1
excelFilePath = ‘YOLO_Object_Type.xlsx’;
% Read data from the Excel file
data = cell2mat(excelFilePath);
%iwant = cellfun(@cell2mat,data)
object = data;
else
object =0;
end simulink, matlab function MATLAB Answers — New Questions