Generate Code with Structure with Different Size Matrices

1 次查看(过去 30 天)
Hello,
I'm trying to use MATLAB Coder to generate code for the following code:
for iScaleIdx = 1:numScales
gaussianKernelStd = vGaussianKernelStd(iScaleIdx);
gaussianKernelRadius = ceil(gaussianKernelStd * GAUSSIAN_KERNEL_STD_TO_RADIUS_COEF);
vGaussianKernel = exp(-([-gaussianKernelRadius:gaussianKernelRadius] .^ 2) ./ (2 * gaussianKernelStd * gaussianKernelStd));
vGaussianKernel = vGaussianKernel ./ sum(vGaussianKernel(:));
sLpfKernel(iScaleIdx).vLpfKernel = vGaussianKernel;
sLpfKernel(iScaleIdx).lpfKernelRadius = gaussianKernelRadius;
end
The vector `vGaussianKernelStd` is predefined.
As one can see, the `vGaussianKernel` field has different sizes.
The Coder can't handle this out of the box.
How can I make it work?
Thank You.

采纳的回答

Rick Rosson
Rick Rosson 2014-12-14
doc coder.varsize

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Coder 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by