How can I export a Matlab 2D array in Conditional Formatted table in pdf using MATLAB Report Generator?
Afficher commentaires plus anciens
I have some 2D array in Matlab. And I wanted to export this array in pdf in 3 Colour scheme Conditional Formated Table as shown below. How can I do that?

I have searched a code that generate the zebra strip tables. Does there exist such codes to auto do Conditional Formating (Like in Excel)?
I am new to MATLAB Report Generator,How can I achive this task?
import mlreportgen.report.*
import mlreportgen.dom.*
rpt = Report('zebraTable','pdf');
maglen = 8;
mag = magic(maglen);
tb = Table(mag);
% Set the colors for alternating rows
for i = 1:maglen
r = tb.row(i);
if mod(i,2)==0
r.Style = {BackgroundColor('lightsteelblue')};
else
r.Style = {BackgroundColor('white')};
end
end
tb.Style={RowHeight('0.3in'),RowSep('solid'),ColSep('solid')};
tb.Width= '3in';
tb.TableEntriesVAlign = 'middle';
tb.TableEntriesHAlign = 'center';
tb.Border = 'single';
add(rpt,tb)
close(rpt)
rptview(rpt)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB Report Generator Task Examples dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!