How to solve this error "Attempt to extract field 'NormalizePathGains from 'mxArray'?

7 visualizzazioni (ultimi 30 giorni)
How to solve this error "Attempt to extract field 'NormalizePathGains' from 'mxArray'? Here is the code
ChanRD = zeros(K,block_size*Q);
coder.extrinsic('rayleighchan');
for j = 1:K
CHANN = rayleighchan(T_s,F_D);
CHANN.NormalizePathGains = 1;
CHANN.ResetBeforeFiltering = 1;
x = ones(1,Mc_Ber*Q*block_size);% known transmitted signal
ChanRD(j,:) = filter(CHANN,x);

Risposte (1)

Walter Roberson
Walter Roberson il 10 Mag 2016
Before the loop, assign to CHANN a structure array with the proper fields and the maximum size that rayleighchan will allocate. Then the CHANN = rayleighchan(T_s,F_D) assignment will result in the data being pulled out of the mxArray into memory accessible to the function.
  1 Commento
Hs5555
Hs5555 il 28 Ott 2018
hi walter, I've encountered the same problem in the following code:
fitresult = fit(x,y, fit_1); % fit is a function of curve fitting toolbox
slope = fitresult.a;
how do I assign the variable 'fitresult' a structure with the proper fields and the maximum size and how can i find out how much memory to allocate?

Accedi per commentare.

Categorie

Scopri di più su MATLAB Coder in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by