Unwanted quotation marks when appending a table in pdf report
Hi,
I’m struggling with MATLAB Report Generator to append a table in a pdf. My table has string and float values. In the following code, mltable is displayed without quotation marks in MATLAB terminal but if I append it my pdf report, I get :
I looked at all the properties of mltableObj but couldn’t find anything to get rid of the quotation marks. Any suggestion? Should I use another object and/or function?
Thanks in advance!
clear all
clc
import mlreportgen.dom.*
import mlreportgen.report.*
d = Report(‘myMATLABTable’,’pdf’);
% Define the data
variableNames = {‘p_solMaxPower_MW’, ‘p_batNomVoltage_V’, ‘p_batNomPower_MW’};
descriptions = {‘Maximum Solar Power [MW]’, ‘Battery Nominal Voltage [V]’, ‘Battery Nominal Power [MW]’};
values = [10.0, 1000.0, 1.0];
% Convert cell arrays to character arrays
variableNames = char(variableNames);
descriptions = char(descriptions);
% Create and append the table
mltable = table(variableNames, descriptions, values’, ‘VariableNames’, {‘Name’, ‘Description’, ‘Value’});
mltableObj = MATLABTable(mltable);
mltableObj.Border = "solid";
mltableObj.BorderWidth = "1px";
mltableObj.ColSep = "solid";
mltableObj.RowSep = "solid";
mltableObj.HeaderRule = [];
mltableObj.HeaderRule.Border = ‘none’;
tbodyObj = mltableObj.Body;
tbodyObj.TableEntriesStyle = {Color(‘blue’)};
tbodyObj.TableEntriesHAlign = ‘center’;
append(d,mltableObj);
close(d);
rptview(d);Hi,
I’m struggling with MATLAB Report Generator to append a table in a pdf. My table has string and float values. In the following code, mltable is displayed without quotation marks in MATLAB terminal but if I append it my pdf report, I get :
I looked at all the properties of mltableObj but couldn’t find anything to get rid of the quotation marks. Any suggestion? Should I use another object and/or function?
Thanks in advance!
clear all
clc
import mlreportgen.dom.*
import mlreportgen.report.*
d = Report(‘myMATLABTable’,’pdf’);
% Define the data
variableNames = {‘p_solMaxPower_MW’, ‘p_batNomVoltage_V’, ‘p_batNomPower_MW’};
descriptions = {‘Maximum Solar Power [MW]’, ‘Battery Nominal Voltage [V]’, ‘Battery Nominal Power [MW]’};
values = [10.0, 1000.0, 1.0];
% Convert cell arrays to character arrays
variableNames = char(variableNames);
descriptions = char(descriptions);
% Create and append the table
mltable = table(variableNames, descriptions, values’, ‘VariableNames’, {‘Name’, ‘Description’, ‘Value’});
mltableObj = MATLABTable(mltable);
mltableObj.Border = "solid";
mltableObj.BorderWidth = "1px";
mltableObj.ColSep = "solid";
mltableObj.RowSep = "solid";
mltableObj.HeaderRule = [];
mltableObj.HeaderRule.Border = ‘none’;
tbodyObj = mltableObj.Body;
tbodyObj.TableEntriesStyle = {Color(‘blue’)};
tbodyObj.TableEntriesHAlign = ‘center’;
append(d,mltableObj);
close(d);
rptview(d); Hi,
I’m struggling with MATLAB Report Generator to append a table in a pdf. My table has string and float values. In the following code, mltable is displayed without quotation marks in MATLAB terminal but if I append it my pdf report, I get :
I looked at all the properties of mltableObj but couldn’t find anything to get rid of the quotation marks. Any suggestion? Should I use another object and/or function?
Thanks in advance!
clear all
clc
import mlreportgen.dom.*
import mlreportgen.report.*
d = Report(‘myMATLABTable’,’pdf’);
% Define the data
variableNames = {‘p_solMaxPower_MW’, ‘p_batNomVoltage_V’, ‘p_batNomPower_MW’};
descriptions = {‘Maximum Solar Power [MW]’, ‘Battery Nominal Voltage [V]’, ‘Battery Nominal Power [MW]’};
values = [10.0, 1000.0, 1.0];
% Convert cell arrays to character arrays
variableNames = char(variableNames);
descriptions = char(descriptions);
% Create and append the table
mltable = table(variableNames, descriptions, values’, ‘VariableNames’, {‘Name’, ‘Description’, ‘Value’});
mltableObj = MATLABTable(mltable);
mltableObj.Border = "solid";
mltableObj.BorderWidth = "1px";
mltableObj.ColSep = "solid";
mltableObj.RowSep = "solid";
mltableObj.HeaderRule = [];
mltableObj.HeaderRule.Border = ‘none’;
tbodyObj = mltableObj.Body;
tbodyObj.TableEntriesStyle = {Color(‘blue’)};
tbodyObj.TableEntriesHAlign = ‘center’;
append(d,mltableObj);
close(d);
rptview(d); pdf report, table, matlabtable MATLAB Answers — New Questions