显然,我无法生成 [3x3x3] 尺寸的信号:
function Test_SF_02(block)
% Level-2 MATLAB file S-Function.
setup(block);
function setup(block)
% Register number of ports and parameters
block.NumInputPorts = 0;
block.NumOutputPorts = 1;
block.NumDialogPrms = 0;
% Setup functional port properties to dynamically inherited
block.SetPreCompOutPortInfoToDynamic;
% Register the properties of the output port
block.OutputPort(1).SamplingMode = 'Sample';
%block.OutputPort(1).DimensionsMode = 'Variable';
block.OutputPort(1).DimensionsMode = 'Fixed';
block.OutputPort(1).Dimensions = [3 3 3];
% Register sample times
% [-1, 0] : Inherited sample time
block.SampleTimes = [-1 0];
% Register methods called at run-time
block.RegBlockMethod('Outputs', @Outputs);
function Outputs(block)
block.OutputPort(1).Data = zeros(3,3,3);
block.OutputPort(1).Dimensions
分配时发生错误并说
无法将“Test_01/Level-2 MATLAB S-Function”的输出端口 1 的尺寸设置为 [3x3x3]。此模块未设置为处理大于 2 维的信号。
为什么?我看到了块,生成图像帧,即MxNx3
矩阵。
更新
这不是重复的问题。