在Simulink中的function中,有如下代码
function y = image_blur_inject(degree, angle, u)
H = fspecial('motion', degree, angle);
会出现报错:
Computed maximum size of the output of function 'fspecial' is not bounded.
Static memory allocation requires all sizes to be bounded.
The computed size is [:? x :?].
Please consider enabling dynamic memory allocation to allow unbounded sizes.
根据提示,打开Model Settings
选择左边的Simulation Target,在右边勾选Dynamic memory allocation in MATLAB functions
问题解决