Trouble when creating and visualizing a table with COP results

1 visualizzazione (ultimi 30 giorni)
This is a table format related issue. For that reason, I include all the code related to the formatting but not to the COP which gives us no trouble.
import mlreportgen.dom.*;
doc=Document('/fully/qualified/path/to/restab');
table0 = ModelAdvisor.Table(4,4);
% column headings
table0.setColHeading(1, ['var1 [%]']);
table0.setColHeading(2, ['var2 [ms]']);
table0.setColHeading(3, ['var3 [%]']);
table0.setColHeading(4, ['var4 [ms]']);
% row headings
for n=1:4
table0.setRowHeading(n,['Fs=',num2str(FsArr(n))]);
end
for n=1:length(FsArr)
Fs= [...] ;
% GP optimizations here
cvx_begin gp quiet
[...];
cvx_end
cvx_status
var1(n)=[..]; var2(n)=[..]; var3(n)=[..]; var4(n)=[..];
% Set table content
rowIndex=n;
table0.setEntry(rowIndex,1,num2str(var1(n)));
table0.setEntry(rowIndex,2,num2str(var2(n)));
table0.setEntry(rowIndex,3,num2str(var3(n)));
table0.setEntry(rowIndex,4,num2str(var4(n)));
end;
append(doc,table0);
close(doc);
rptview(doc.OutputPath);
The result of the above is a correct optimized set of results, but when we try to visualize the table , we only get a window whose only tab is entitled "root.html", and with mention (in the window of: "[1x1 ModelAdvisor.Table]".
The question is we are probably missing something about format and all, would any one care to give us pointers on how to visualize formatted table of type 'table0' ? Thanks.

Risposta accettata

Mudambi Srivatsa
Mudambi Srivatsa il 28 Giu 2017
you are getting "[1x1 ModelAdvisor.Table]" because MATLAB report generator does not support "ModelAdvisor.Table" and you can append regular MATLAB tables. One workaround is to get entries of the ModelAdvisor table and create a regular table out of it which can be appended to the HTML report.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by