Scatter plot of data based on speed and load

조회 수: 1 (최근 30일)
Sridutt Gokul
Sridutt Gokul 2019년 2월 4일
댓글: KSSV 2019년 2월 5일
Hi,
I am new to Matlab and was wondering if I can plot something like this.
I have a 275x3 matrix and particular speed and load points for an engine that form a 275x2 matrix
I want the speed and torque/fueling to form the x and y axis while I have the 275x3 matrix as smooth scatter line fed columnwise.
The output should be 3 lines that form a contour over the speed and load curve for the engine.
The input is like this:
Speed torque/fueling
700 9
700 13
700 17
700 20
700 25
700 30
700 40
700 60
750 9
750 13
750 17
750 20
750 25
750 30
750 35
800 9
800 13
800 17
800 20
800 25
800 30
800 40
800 60
800 90
800 125
800 145
850 9
850 13
850 17
850 20
850 25
850 30
850 35
900 9
900 13
900 17
900 20
900 25
900 30
900 40
900 60
900 90
900 125
900 150
950 9
950 13
950 17
950 20
950 25
950 30
950 35
950 60
950 90
950 125
950 150
950 175
1000 9
1000 13
1000 17
1000 20
1000 25
1000 30
1000 40
1000 60
1000 90
1000 125
1000 150
1000 175
1000 198
1050 9
1050 13
1050 25
1050 30
1050 35
1050 60
1050 90
1050 125
1050 150
1050 175
1100 9
1100 13
1100 17
1100 20
1100 25
1100 30
1100 40
1100 60
1100 90
1100 125
1100 150
1100 175
1100 205
1150 9
1150 13
1150 17
1150 20
1150 25
1150 30
1150 35
1200 9
1200 13
1200 17
1200 20
1200 25
1200 30
1200 40
1200 60
1200 90
1200 125
1200 150
1200 175
1200 215
1250 9
1250 13
1250 17
1250 20
1250 25
1250 30
1250 35
1300 9
1300 13
1300 17
1300 20
1300 25
1300 30
1300 40
1300 60
1300 90
1300 125
1300 150
1300 175
1300 215
1350 9
1350 13
1350 17
1350 20
1350 25
1350 30
1350 35
1400 9
1400 13
1400 17
1400 20
1400 25
1400 30
1400 40
1400 60
1400 90
1400 125
1400 150
1400 175
1400 215
1450 9
1450 13
1450 17
1450 20
1450 25
1450 30
1450 35
1500 9
1500 13
1500 17
1500 20
1500 25
1500 30
1500 40
1500 60
1500 90
1500 125
1500 150
1500 175
1500 215
1550 20
1550 25
1550 30
1550 35
1600 20
1600 25
1600 30
1600 40
1600 60
1600 90
1600 125
1600 150
1600 175
1600 215
1650 20
1650 25
1650 30
1650 35
1700 20
1700 25
1700 30
1700 40
1700 60
1700 90
1700 125
1700 150
1700 175
1700 215
1750 20
1750 25
1750 30
1750 35
1800 20
1800 25
1800 30
1800 40
1800 60
1800 90
1800 125
1800 150
1800 175
1800 215
1850 20
1850 25
1850 30
1850 35
1900 25
1900 30
1900 40
1900 60
1900 90
1900 125
1900 150
1900 175
1900 205
1950 25
1950 30
1950 35
2000 25
2000 30
2000 40
2000 60
2000 90
2000 125
2000 150
2000 175
2000 195
2050 25
2050 30
2050 35
2100 25
2100 30
2100 40
2100 60
2100 90
2100 125
2100 150
2100 175
2100 190
2150 25
2150 30
2150 35
2200 30
2200 40
2200 60
2200 90
2200 125
2200 150
2200 173
2200 177
2230 170
2250 30
2250 35
2300 30
2300 40
2300 60
2300 90
2300 125
2300 150
2350 30
2350 35
2400 30
2400 40

답변 (1개)

KSSV
KSSV 2019년 2월 4일
편집: KSSV 2019년 2월 4일
Read about Scatter, griddata, scatteredinterpolant ..to plot a contour straight away from scattered data, you can use the below function:
It seems your data is structured...you can reshape it to a grid and use contour. If you want more help...attach your data as a text file.
  댓글 수: 4
Sridutt Gokul
Sridutt Gokul 2019년 2월 5일
I'm sorry, my requirements have changed.
I want to do a scatter of columns 3 to 5 with correspondence to engine speed being points on the x axis and torque being points on the y axis.
So I can tell if column one is more towards a certain speed/torque area.
KSSV
KSSV 2019년 2월 5일
Read the respective columns and use Scatter
A = importdata('data.txt') ;
data = A.data ;
x = data(:,1) ; % speed
y = data(:,2) ; % torque
c1 = data(:,3) ; % cyl1
c2 = data(:,4) ; % cyl2
c3 = data(:,5) ; % cyl3
figure
hold on
scatter3(x,y,c1,20,'r','filled')
scatter3(x,y,c2,20,'b','filled')
scatter3(x,y,c3,20,'g','filled')
legend({'cyl1','cyl2','cyl3'})

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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by