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!