フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to read the words and numbers to different cells according to space and next line ?

3 ビュー (過去 30 日間)
Muharrem Askin
Muharrem Askin 2012 年 5 月 28 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have a file to be read. But this file contains numbers, characters and specific signs. As an exp. it goes like this;
EXTDC .8 MEND
MSTART ADAT NFOILS 9 NFOIL 1 FTYPE F NTHICK 2 NREYN 3 1 -1 -1
I would like to read each word and numbers to different cells. Each word or number separated from each other by space or next line should be different array. How can I do that ?

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2012 年 5 月 28 日
id=fopen('nameyourfile.txt','r');
nms = textscan(id,'%s');
fclose(id);
out = nms{1};

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by