Filter löschen
Filter löschen

Generate Code with Structure with Different Size Matrices

1 Ansicht (letzte 30 Tage)
Royi Avital
Royi Avital am 13 Dez. 2014
Kommentiert: Rick Rosson am 14 Dez. 2014
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.

Akzeptierte Antwort

Rick Rosson
Rick Rosson am 14 Dez. 2014
doc coder.varsize
  2 Kommentare
Royi Avital
Royi Avital am 14 Dez. 2014
Hi,
Could you elaborate as I did looked there and couldn't create a code which will work.
Rick Rosson
Rick Rosson am 14 Dez. 2014
Please post your code and the exact error message.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by