get the numerical values from char

Hello everyone, Is there a way to get the numerical column which starts with -0.00013494 into an array in matlab?

2 件のコメント

Chunru
Chunru 2022 年 9 月 21 日
編集済み: Chunru 2022 年 9 月 21 日
attach the data as .mat file. Or you can try str2double after skipping the header lines.
bus gogen
bus gogen 2022 年 9 月 21 日
I have a lot data. how to skip the header line?

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

回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 9 月 21 日

0 投票

data = cell2mat(textscan(val, '%f', 'HeaderLines' ,17));
The 17 here is my estimate from counting blank lines. I would have been able to provide a more accurate number if you had posted actual text instead of just a picture of text.

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

質問済み:

2022 年 9 月 21 日

回答済み:

2022 年 9 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by