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

6 次查看(过去 30 天)
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);

回答(1 个)

Walter Roberson
Walter Roberson 2016-5-10
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 个评论
Hs5555
Hs5555 2018-10-28
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?

请先登录,再进行评论。

类别

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