compare(data,sys) can not be used inside function?

1 次查看(过去 30 天)
Hallo @ all.
I think I stumbled upon a bug in Matlab R2011b:
My goal was to compare the fit of different estimated models to measured data by using the function compare(data, sys) from ident toolbox and something strange happened. Although I am able to use the function in 'base' Workspace
[~, fit, ~] = compare(dataPack{1,1}, b)
fit =
90.5454
I can not use it inside another user defined function
function fit = fitOfModel(iddataObj, varargin )
[~, fit, ~] = compare(iddataObj,varargin);
end
calling this function with the same input as before returns an error
[~, fit, ~] = fitOfModel(dataPack{1,1}, b)
Undefined function 'compare' for input arguments of type 'iddata'.
I have no idea as to why this might happen. Could someone please enlighten me? Is this a bug?
Ps.: dataPack is a cell array where each cell contains an iddata object with data from experiments and b is the estimated P1D idproc model for the data in dataPack{1,1}

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Residual Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by