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.

 채택된 답변

AJ von Alt
AJ von Alt 2014년 8월 6일

0 개 추천

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))';

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

질문:

2014년 8월 6일

답변:

2014년 8월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by