Generate Code with Structure with Different Size Matrices

조회 수: 2 (최근 30일)
Royi Avital
Royi Avital 2014년 12월 13일
댓글: Rick Rosson 2014년 12월 14일
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
  댓글 수: 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개)

카테고리

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