Home > other >  Matlab vector length must be consistent
Matlab vector length must be consistent

Time:02-04

Population=[133126133, 770134, 413135, 069135, 738136, 427137, 122137, 866138, 639139, 538].
Year=[2009201 0201 1201 2201 3201 4201 5201 6201 7201 8];
P1=pchip (year. Population, 2019, 2021);
P2=spline (year. Population, 2019, 2020);
figure;
Plot (year, population, 'o', 2019, 2021, p1, 'r * -', 2019, 2021, p2, 'bx -')
Legend (' sample points', 'section three times',' cubic spline ', 'Location', 'SouthEast)

Where is the wrong
  • Related