MATLAB: How to fill the area between these two curves? I tried using fill function along with the flipud and fliplr function but the problem is both the curves have different x and y value.s.

fill

Curve 1:
x =[ -0.205025192827071
0.198703578841051
0.615224353432156
1.04020552854911
1.46743336785841
1.89025447652119
2.30319668673785
2.70292519745741
3.08826267443651
3.45960596715821
3.81821370589803
4.16564675053216
4.50342679925073
4.83286895141765
5.15502181411896
5.47066304265979
5.78031833130538
6.08428729476497
6.38266942104919
6.67538908380451
6.96222229479095
7.24283064446260
7.51681015902328
7.78376415571862
8.04340806738783
8.29570801861414
8.54104105716707
8.78034384489068
9.01519630846863
9.24778398779851
9.48071363707745
9.71671721171325
9.95833671431360
10.2076959942592
10.4664256315102
10.7357444512172
11.0166570147677
11.3102176390849
11.6178267273785
11.9415399164715
12.2843550368133
12.6503504166356
13.0443064943080
13.4700317378880
13.9265246961548
14.4030412638706
14.8787119274105
15.3317315905194
15.7507647209062];
y =[4.13990113133945
3.94986826672789
3.81002740219444
3.72270291181867
3.68819449181665
3.70403704340682
3.76526881903020
3.86548544082293
3.99800141226079
4.15661163759698
4.33586913553223
4.53104691910978
4.73797509953952
4.95287090099547
5.17220914768906
5.39264141878906
5.61095681044633
5.82407437487551
6.02905910289576
6.22315605904830
6.40383945483297
6.56887439607321
6.71638825594372
6.84494554693115
6.95361447769739
7.04200593041924
7.11025981738708
7.15895649901056
7.18894989393509
7.20115480245690
7.19635844704452
7.17513689338441
7.13792241044037
7.08520363106761
7.01778876342298
6.93705432651392
6.84513382943809
6.74504629457267
6.64080349602027
6.53756618623600
6.44195436444026
6.36265634640300
6.31146559729891
6.30456213207732
6.36279562695408
6.50829001849157
6.75656242179704
7.11112355612135
7.56863191714500];
Curve 2:
x=[0.817270090786255
1.02578621707732
1.22151034044539
1.40877406328762
1.59379112193751
1.78321491123391
1.98251759897643
2.19503398621606
2.42194140719615
2.66284301243363
2.91648017165299
3.18129202497805
3.45575687421866
3.73855962001092
4.02865165526880
4.32525532468715
4.62784493400075
4.93612086850034
5.24998364017530
5.56950887537916
5.89492056235191
6.22655711063944
6.56482249403795
6.91011339530179
7.26271438159176
7.62265932832463
7.98957118773089
8.36251329796647
8.73990573234770
9.11956295097700
9.49887819965725
9.87511952298063
10.2457449183395
10.6086305363530
10.9621457970612
11.3050718753135
11.6364042097221
11.9550884833641
12.2597242930296
12.5482560018959
12.8176857795132
13.0639352976501
13.2822241179369
13.4687437723160
13.6244957120085
13.7602240422519
13.8967982766712
14.0560235115214
14.2492352790938];
y=[5.85888698151447
5.77083897201892
5.71591756218567
5.68844888604848
5.68419893018448
5.70117062217994
5.73939265574169
5.79992244355623
5.88374157697681
5.99105127791730
6.12105165651375
6.27203680256095
6.44161465302004
6.62693394855257
6.82487071777891
7.03216609368991
7.24552252295382
7.46166829816623
7.67739854664093
7.88959806662405
8.09524922538907
8.29142718320358
8.47528549163311
8.64403819291220
8.79495023441265
8.92535546263560
9.03272723794433
9.11482398789037
9.16991306842850
9.19704041183346
9.19627595750996
9.16885420227882
9.11716381164908
9.04460443053566
8.95538044318065
8.85430920893615
8.74668935435611
8.63822922133877
8.53499660001236
8.44331947343959
8.36953272053664
8.31942601762040
8.29726397688500
8.30456171736345
8.33985872476750
8.40217122373923
8.49893023098425
8.65143810100473
8.88977132514496];

Best Answer

Try this:
figure
plot(x1, y1, x2, y2)
hold on
patch([x1; flipud(x2)], [y1; flipud(y2)], 'g')
hold off
They are column vectors, so you need to concatenate ‘x1’ with the flipped version of ‘x2’, and the same for ‘y1’ and ‘y2’ (where (x1,y1) are the first curve, and (x2,y2) the second curve).
HO2292~1.PNG
EDIT — Added plot image.