How can i smooth my contour map?

12 Ansichten (letzte 30 Tage)
Alex Yande
Alex Yande am 3 Mai 2019
Hi,
I have a set of datas and you can see them at code box. I should smooth my curves on map, but i am not be able to do it. How can i achieve this problem?
clear all
clc
rpm=[800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500]
pwr=[0.001 25 50 75 100 125 150 155 163]
con=[1000 240 220 218 NaN NaN NaN NaN NaN
1000 250 221 216 217 NaN NaN NaN NaN
1000 260 222 214 214 NaN NaN NaN NaN
1000 265 224 214 213 213 NaN NaN NaN
1000 275 226 214 211 211 NaN NaN NaN
1000 285 230 216 211 210 210 NaN NaN
1000 295 235 218 212 210 210 NaN NaN
1000 300 239 221 214 210 210 NaN NaN
1000 308 245 225 216 212 210 NaN NaN
1000 316 249 229 219 214 210 211 NaN
1000 332 260 235 223 217 214 214 NaN
1000 350 266 240 228 221 217 216 NaN
1000 364 279 247 234 225 222 219 224
1000 386 293 257 240 230 228 227 226
1000 390 325 275 250 238 239 236 236
1000 395 350 295 270 250 240 238 NaN
1000 400 360 325 290 NaN NaN NaN NaN
1000 600 400 NaN NaN NaN NaN NaN NaN]
z=1:18
o=1:9
ss=50
rpm_new=interp1(z,rpm,linspace(1,18,ss))
pwr_new=interp1(o,pwr,linspace(1,9,ss))
for k=1:ss
for p=1:ss
con_new(k,p)=interp2(pwr,rpm,con,pwr_new(p),rpm_new(k))
end
end
%contourf(rpm,pwr,con')
contourf(rpm_new,pwr_new,con_new')
  3 Kommentare
Rena Berman
Rena Berman am 13 Mai 2019
(Answers Dev) Restored edit
Bjorn Gustavsson
Bjorn Gustavsson am 14 Mai 2019
Why do you want to "should smooth"? Contour map as it is looks perfectly reasonable and reflects the data that you have. If you want smooth contours you should get yourself smooth data or give some reason as to why you cannot live with the data you have. Your plots indicate nothing in way of noise that one could reasonably argue should be suppressed...

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Bjorn Gustavsson
Bjorn Gustavsson am 3 Mai 2019
Have a look at these file-exchange contributions:
contour-line-smoothing, Smoothing 2D-Contours Using Local Regression Lines. There were a batch of other contributions that showed up when searching for "smooth contour", so if neither of those two works for you look
at the others...
HTH

Kategorien

Mehr zu Contour Plots 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