How to format text to change font size

%A sample code
x1 = randi([0, 1], [6,4])
S=size(x1,1);
R=1;
%open powerpoint and evaluate toPPt and it should work
toPPT('setTable',{{'<s font-size:6.5>HoleNo.</s>','<s font-size:6.5>X [mm]</s>','<s font-size:6.5>Y [mm]</s>','<s font-size:6.5>Z [mm]</s>'};{(sprintf('<s font-size:12>%g</s>',x1(R:S,1:4)))}},'SlideNumber',2,'pos%',[15,20],'Width',200,'Height',50,'pub',doPublishing)
I think the error occurs (sprintf('<s font-size:12>%g</s>',x1(R:S,1:4))) when I try to change the font size of the array

9 Comments

Adam Danz
Adam Danz on 5 Aug 2020
Edited: Adam Danz on 5 Aug 2020
It may be helpful to have a minimal working example -- something we can execute to reproduce the problem.
Remember that we can't copy-paste code from screen shots.
I put a sample code, the main problem is when I use sprintf to change the font size in the table
sprintf('<s font-size:12>%g</s>',x1(R:S,1:4))
should probably be
sprintf('<s font-size:12>%g</s>',x1(R:S,1:4).')
However, you did not indicate what error you are observing?
I do not see where you are telling it to end a row in the table ?
I still get an error message 'Your command was not performed succefully!'
I would suggest assigning the result of the {{'<s etc}} to a variable and examining it
We can't run your example (what's doPublishing?).
I still don't know what the goal is.
How will the sprintf output be used?
What is the full error message (all of it)?
A lot of this would be cleared up if we could recreate the problem on our end.
%make sure you have powerpoint closed and you can see that i want to change the font size of the numers in x1 within the table created on powerpoint.
doPublishing = 1;
x1 = randi([0, 1], [6,4])
S=size(x1,1);
R=1;
toPPT('setTable',{{'<s font-size:6.5>HoleNo.</s>','<s font-size:6.5>X [mm]</s>','<s font-size:6.5>Y [mm]</s>','<s font-size:6.5>Z [mm]</s>'};{x1(R:S,1:4)}},'SlideNumber',2,'pos%',[15,20],'Width',200,'Height',50,'pub',doPublishing)
Adam Danz
Adam Danz on 6 Aug 2020
Edited: Adam Danz on 6 Aug 2020
What is toPPT?
Just found this. I'm assuming this is the function.
correct, basically trying to create a powerpoint presentation but I want to change the font size in the table

Sign in to comment.

Answers (0)

Categories

Asked:

on 5 Aug 2020

Commented:

on 6 Aug 2020

Community Treasure Hunt

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

Start Hunting!