MATLAB: Datastoreによりデータの読み込み

datastore日本語

以下のコードで365個テキストファイルを読み込もうとしたら以下のエラーが出てしまいました、プロパティーを変更しなくてはいけないと考えているのですがうまくいかず何かアドバイス頂けると幸いです。 テキストファイルは添付のものと形式(区切り位置など)、データ数全て同じものがTA20040101.txt~TA20041231.txtです。
dsX = datastore ('TA2004*.txt');
dsX.MultipleDelimitersAsOne = true;
dsX.NumHeaderLines = 0;
x = readall(dsX);
y = reshape(x.Var1,10368,[]);
以下エラー
Error using datastore (line 165)
Cannot detect TextscanFormats from file: 'C:\Users\Naoki Ishibashi\Documents\MATLAB\HW3\TA2004\TA20040101.txt'. Specify TextscanFormats when you create the datastore. Verify the Text
Format and Advanced Text Format Properties.
Error in test (line 1)
dsX = datastore ('TA2004*.txt');

Best Answer

添付頂いた text ファイルは値がスペースで区切られ横一列に並んだデータの様です。 RowDelimiter オプションで「スペースで行を区切る」と認識させることで、すべてのデータを縦一列の形で読み取ることが出来ます。
dsX = datastore ('TA2004*.txt', 'ReadVariableNames', false, 'RowDelimiter', ' ');
x = readall(dsX);
y = reshape(x.Var1,10368,[]);