Use tfest within parallel loop
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Respuestas (1)
Sean de Wolski
el 7 de Ag. de 2017
assign the output back to a cell array
estSys{i} = tfest(...)
0 comentarios
Ver también
Categorías
Más información sobre Transfer Function Models en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!