Clear Filters
Clear Filters

How to add several forced line breaks inside a table cell, when I try to generate a Microsoft word report using Matlab?

14 views (last 30 days)
Hi,
I'm trying to generate a Microsoft word report using Matlab, which contains serval tables.
I want to add several forced line breaks inside one table cell, like the figure below.
How can I have this?
Thanks!

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 12 Dec 2023
I tried and the line break in a cell in an Excel file is char(10). I think it is likely the same in Word.
In MATLAB, newline is the same as char(10).
So you can construct your table data like this:
data{1,2}=['Aaa',newline,'Bbb',newline,'Ccc']

More Answers (0)

Categories

Find more on Tables in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!