get the numerical values from char

조회 수: 1 (최근 30일)
bus gogen
bus gogen 2022년 9월 21일
답변: Walter Roberson 2022년 9월 21일
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일
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.

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by