Textscan from a text file that contains signs

1 回表示 (過去 30 日間)
Quazi Shammas SAYEED
Quazi Shammas SAYEED 2020 年 7 月 8 日
コメント済み: Rik 2020 年 7 月 8 日
Hello everyone.
I would like to read the number only from this following text file. I am finiding difficulties to write the command.
I would like to keep 2.428E+08, 1.383E+05, 1.335E+05 . . . in an array
< S P R I N G P R O P E R T I E S
<
*PSPG 'KR1' SKLT +- K1 2.428E+08 HDMP 0.10
<
*PSPG 'KS1' SKLT +- K1 1.383E+05 HDMP 0.20
*PSPG 'KS2' SKLT +- K1 1.335E+05 HDMP 0.20
*PSPG 'KS3' SKLT +- K1 1.243E+05 HDMP 0.20
Thank you.

採用された回答

Rik
Rik 2020 年 7 月 8 日
Use strspilt to split each line. Then you can check if there are enough elements on that line, select the 6th element and use str2double.
  2 件のコメント
Quazi Shammas SAYEED
Quazi Shammas SAYEED 2020 年 7 月 8 日
Thank you Rik for your instruction. Can you please tell me, how to each line? before strsplit.
I am very new in programming or Matlab. I am sorry.
Rik
Rik 2020 年 7 月 8 日
How do you read your data from a file? That time is the easiest time to divide your file by line, which makes the rest of the process a lot easier.

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

その他の回答 (0 件)

カテゴリ

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