NEED HELP WITH LOADING DATA

1 回表示 (過去 30 日間)
nick pa
nick pa 2014 年 7 月 27 日
編集済み: Star Strider 2014 年 7 月 27 日
SO I cant seem to get the data loaded into this Matlab file and get it working. Here is what i have and what is displays. I also attached the activity above.
fid = fopen('PA_13_2_1_input.dat')
C = textscan(fid, '%s %s %s %s %s %s %s %s %s %s')
fclose(fid)
output
C =
{51x1 cell} {51x1 cell} {51x1 cell} {51x1 cell} {51x1 cell} {51x1 cell} {51x1 cell} {51x1 cell} {51x1 cell} {51x1 cell}
ans =
0

回答 (1 件)

dpb
dpb 2014 年 7 月 27 日
Looks like you've got 51 rows of 10 columns there are in the cell array C. I'd say you've got the data "loaded" just fine.
What you are likely looking for is a slight modification and writing
fmt=repmat('%s',1,10);
C = textscan(fid, fmt,'collectoutput',true);
To see the results, try
C{:}
To dereference the content of cell arrays see

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by