フィルターのクリア

import text file in loop

4 ビュー (過去 30 日間)
Nicolas
Nicolas 2018 年 4 月 6 日
回答済み: Nicolas 2018 年 4 月 6 日
Hi, I'm creating text files from another program that I want to import into Matlab. I have been using the import wizard matlab option (see attachment), however the size of each file is different. In the function created by Matlab, I would like to know if the 'formatSpec' can be defined automatically or if I can create it for every new file?
  2 件のコメント
Rik
Rik 2018 年 4 月 6 日
If you can deduce for each file what the format spec should be, you can just use it as an input to this function
Nicolas
Nicolas 2018 年 4 月 6 日
編集済み: Nicolas 2018 年 4 月 6 日
what I know is the number of time '%s' is repeated in the 'formatSpec'. not sure if I can build 'formatSpec' myself? be able to write %s."number of values"%[^\n\r]

サインインしてコメントする。

採用された回答

Nicolas
Nicolas 2018 年 4 月 6 日
Answer to automatically build 'formatSpec' using the import function created by Matlab.
A = repmat('%s',1,201);
B = '%[^\n\r]';
formatSpec = strcat(A,B);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by