필터 지우기
필터 지우기

Divide data in parts and plot them on a vertical line

조회 수: 2 (최근 30일)
Jialin HE
Jialin HE 2022년 2월 24일
댓글: Jialin HE 2022년 2월 24일
Hello!
I have a matrix that stores my probability, number of data analyzed and time (time and #samples are related, every single data is sampled at 0.033 seconds, so 3.3 for 100); it looks like:
0.873615503511876 100 3.30000000000000
0.902974727374816 100 3.30000000000000
0.900676294700403 100 3.30000000000000
0.936103354207504 200 6.60000000000000
0.897578193607001 200 6.60000000000000
0.944744655111605 200 6.60000000000000
0.972746082496182 300 9.90000000000000
0.940582356717829 300 9.90000000000000
0.977908283040241 300 9.90000000000000
0.962956328635856 400 13.2000000000000
0.968370651998859 400 13.2000000000000
0.980665507251175 400 13.2000000000000
I want to have a 2D plot with probability values on y axis and time on x axis, where all datas recorded at the same time are allineated vertically. In this way I should get a plot at the end where on x I have 3.3, 6.6, 9.9, 13.2 and for every one of these 3 point on y axis.
Can someone help me do that? Thanks!

답변 (1개)

Scott MacKenzie
Scott MacKenzie 2022년 2월 24일
From your description, this seems to work:
M = [
0.873615503511876 100 3.3;
0.902974727374816 100 3.3;
0.900676294700403 100 3.3;
0.936103354207504 200 6.6;
0.897578193607001 200 6.6;
0.944744655111605 200 6.6;
0.972746082496182 300 9.9;
0.940582356717829 300 9.9;
0.977908283040241 300 9.9;
0.962956328635856 400 13.2;
0.968370651998859 400 13.2;
0.980665507251175 400 13.2];
scatter(M(:,3), M(:,1), 'filled');
xlabel('Time');
ylabel('Probability');
  댓글 수: 1
Jialin HE
Jialin HE 2022년 2월 24일
I figured that out after and I did the same, thank you anyway!

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

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by