SysIdent Compare: Plot only selected outputs

2 views (last 30 days)
Hello!
using "compare" from the System Identification Toolbox creates a quick way to compare the created model with the data. But when I use a large model (e.g. with 103 output variables), you cannot see anything in the plot.
% code to plot model comparison with measurement data
compare(id_data, model);
Is there an option to plot only selected outputs using compare?
Thanks,
Christoph

Accepted Answer

Christoph
Christoph on 3 Jun 2024
I found a solution: we can cut off selected output data of the id_data object before using compare:
compare(id_data(:,50:70,:), model)
This will now only plot output channels 50 to 70, but will also produce some warnings (one for each missing output):
Warning: Output channels required for prediction or initial condition estimation are not available in the validation data object. Prediction horizon of Inf and zero initial conditions will be used.
These warnings can be suppressed via:
warn_id = 'Ident:analysis:compareChk16';
warning('off',warn_id)

More Answers (1)

Harald
Harald on 29 May 2024
Hi,
my experience with System Identification Toolbox is admittedly limited.
From the documentation, I would try to pass a compareOptions object to compare:
opt = compareOptions('Samples', Samples);
compare(id_data, model, opt);
From the doc of compareOptions:
Specify Samples as a vector containing the data sample indices. For multiexperiment data, use a cell array of Ne vectors, where Ne is the number of experiments.
Perhaps, this already helps?
Best wishes,
Harald
  3 Comments
Harald
Harald on 3 Jun 2024
Hi Christoph,
could you share more details on what you have tried, please? Unless you are still getting the same results, how do they now deviate from what you are looking for?
Best wishes,
Harald
Christoph
Christoph on 4 Jun 2024
Hi Harald,
i tried your suggestion, i.e.:
opt = compareOptions('Samples', [1:10]);
compare(id_data, model, opt)
but there were not any changes to the plot:
My assumption was that the number of samples (time samples) are now cut (therefore only the ten first timepoints of data are plotted), but this was not the case. I don't know what exactly this option does.

Sign in to comment.

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!