get the numerical values from char

2 Ansichten (letzte 30 Tage)
bus gogen
bus gogen am 21 Sep. 2022
Beantwortet: Walter Roberson am 21 Sep. 2022
Hello everyone, Is there a way to get the numerical column which starts with -0.00013494 into an array in matlab?
  2 Kommentare
Chunru
Chunru am 21 Sep. 2022
Bearbeitet: Chunru am 21 Sep. 2022
attach the data as .mat file. Or you can try str2double after skipping the header lines.
bus gogen
bus gogen am 21 Sep. 2022
I have a lot data. how to skip the header line?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 21 Sep. 2022
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.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by