Use tfest within parallel loop
4 views (last 30 days)
Show older comments
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
Answers (1)
Sean de Wolski
on 7 Aug 2017
assign the output back to a cell array
estSys{i} = tfest(...)
0 Comments
See Also
Categories
Find more on Transfer Function Models in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!