Generate Code with Structure with Different Size Matrices

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 日

0 投票

doc coder.varsize

2 件のコメント

Royi Avital
Royi Avital 2014 年 12 月 14 日
Hi,
Could you elaborate as I did looked there and couldn't create a code which will work.
Rick Rosson
Rick Rosson 2014 年 12 月 14 日
Please post your code and the exact error message.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Coder についてさらに検索

製品

タグ

質問済み:

2014 年 12 月 13 日

コメント済み:

2014 年 12 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by