Use tfest within parallel loop
2 ビュー (過去 30 日間)
古いコメントを表示
I am trying to use the function tfest to estimate a transfer function from frequency response data (frd) within a parlor loop. I am running into transparency violation issues within the tfest function and am getting the following error:
Error using tfest (line 94)
Transparency violation error. See Parallel Computing Toolbox documentation about Transparency
To the best of my knowledge the variables I am using are defined correctly as the tfestimate function does not have any transparency issues a few lines earlier in the code.
Thank you for any advice. The relevant code snippet is shown below:
parfor i = 1:128
len = LENGTH(i,k);
Input = reshape(INPUT(i,k,1:len),[len,1]);
exp_data = reshape(OUTPUT(i,k,1:len),[len,1]);
time = reshape(TIME(i,k,1:len),[len,1]);
fs = 50; % Hz
minFreq = 0.1; % The minimum frequency that the fit is performed from
maxFreq = 3.5; % The maximum frequency that the fit is performed to
np = 2; % Force number of poles in the estimated transfer function
iodelay = NaN; % Initialize estimated pure delay in the system
f = linspace(minFreq,maxFreq,1024);
Txy = tfestimate(Input,exp_data,[],[],f,fs);
measSysPhase = (180/pi)*phase(Txy);
measSysMag = mag2db(abs(Txy));
% Estimated transfer function fit to frequency data
TxyData = frd(Txy,2*pi*f);
estSys = tfest(TxyData,np,[],iodelay);
end
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Transfer Function Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!