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

17 vues (au cours des 30 derniers jours)
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!

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 12 Déc 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']

Plus de réponses (0)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by