file1 = dlmread('Matched_TNG20100518CISI_N.txt','', 5, 0) fid = fopen(file1, 'r') Axcel1=fscanf(file1,'%g %g %g %g %g\n',[4,Inf])';
Error using fopen File identifier must be an integer-valued scalar of type double.
Any one can help me?

回答 (1 件)

Star Strider
Star Strider 2018 年 10 月 11 日

0 投票

Simply use the one line:
file1 = dlmread('Matched_TNG20100518CISI_N.txt','', 5, 0);
Then, check to see what ‘file1’ contains. It should be a matrix of numeric data that you can access directly.

4 件のコメント

Skydriver
Skydriver 2018 年 10 月 11 日
This is my contain of file Time Series matched accelerogram: Tng20100518CISI_N.txt
Time Step: 0.01 s
Time(sec) Acc(g) Vel(m/sec) Dsp(m)
0.00000 0.00000 0.00000 0.00000
0.01000 -0.00000 -0.00000 -0.00000
0.02000 -0.00000 -0.00000 -0.00000
0.03000 0.00000 -0.00000 -0.00000
0.04000 -0.00000 0.00000 -0.00000
0.05000 -0.00000 -0.00000 -0.00000
0.06000 -0.00000 -0.00000 -0.00000
0.07000 0.00000 -0.00000 -0.00000
0.08000 0.00000 -0.00000 -0.00000
0.09000 -0.00000 -0.00000 -0.00000
0.10000 -0.00000 -0.00000 -0.00000
0.11000 0.00000 -0.00000 -0.00000
0.12000 0.00000 -0.00000 -0.00000
0.13000 -0.00000 -0.00000 -0.00000
0.14000 0.00000 -0.00000 -0.00000
0.15000 0.00000 -0.00000 -0.00000
0.16000 -0.00000 -0.00000 -0.00000
0.17000 -0.00000 -0.00000 -0.00000
0.18000 -0.00000 -0.00000 -0.00000
But the answer is the same : Error using fopen
File identifier must be an integer-valued scalar of type double.
Star Strider
Star Strider 2018 年 10 月 11 日
Do not use fopen.
The dlmread function reads your file. You do not have to do anything else. You can now use the numeric rows of your matrix in your calculations. You do not have to do anything else to your file after you have imported it with dlmread.
Skydriver
Skydriver 2018 年 10 月 12 日
Okay, thx, It's done
Star Strider
Star Strider 2018 年 10 月 12 日
My pleasure.
If my Answer helped you solve your problem, please Accept it!

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

カテゴリ

ヘルプ センター および File ExchangeLarge Files and Big Data についてさらに検索

タグ

質問済み:

2018 年 10 月 11 日

コメント済み:

2018 年 10 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by