Error with plotting a massive text file data set.

조회 수: 1 (최근 30일)
Niki Wilson
Niki Wilson 2023년 3월 14일
답변: Cameron 2023년 3월 14일
I have a really big data set consisting of a time stamp and a measured value. It looks like this:
I plotted the data using the following code:
load file.txt;
x = file(:, 2);
y = file(:, 3);
plot(x, y);
It runs without throwing errors, but the x values are all just 11. That was the only number that saved.
Does anyone know what I am doing wrong? Also, is there a way to manipulate the data set so that the time stamp starts from 0 and each subsequent point is the amount of time that has elapsed from the previous measurment?
Thanks.
  댓글 수: 2
Mathieu NOE
Mathieu NOE 2023년 3월 14일
hello
can you share an extract of you file ?
Niki Wilson
Niki Wilson 2023년 3월 14일
This is the entire data set.

댓글을 달려면 로그인하십시오.

채택된 답변

Cameron
Cameron 2023년 3월 14일
data = readtable('Analysis1.txt');
plot(data.Var1,data.Var2)

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by