Azzera filtri
Azzera filtri

convert character array to cell

3 visualizzazioni (ultimi 30 giorni)
Rashmil Dahanayake
Rashmil Dahanayake il 6 Ago 2014
Risposto: AJ von Alt il 6 Ago 2014
Hi, I'm trying to generate a file list using a system command.
[status ,out]=system('dir mat')
The format of the variable is in char format. How can I save this in a cell, to display each line in a new row of the cell.

Risposta accettata

AJ von Alt
AJ von Alt il 6 Ago 2014
You can use strsplit to split the string into cells. For your output, you can use the line feed character char(10) as the delimiter, so a new cell is created for each new line.
out_cell = strsplit(out,char(10))';

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by