MATLAB Answers

0

Smooth curves how to

Asked by Simba Matema on 15 Jul 2019
Latest activity Answered by KSSV
on 15 Jul 2019
Accepted Answer by KSSV
Hi
got three data points and need to join them with smooth curve insted of a straight line.
please help.
commands below..
x=[1 2 3];
y=[1.22 3.31 1.91];
plot(x,y)
hold on
y1=[1.1 1.65 0.60];
plot(x,y1)
hold on
y2=[1.22 3.48 2.44];
plot(x,y2)
hold on
y3=[2.61 2.61 2.39];
plot(x,y3)
hold on
y4=[1.39 2.44 0.87]
y4 =[1.3900 2.4400 0.8700]
plot(x,y4)
hold on
y5=[0.57 0.65 0.28];
plot(x,y5)
hold on
z=[2.0 2.0 2.0];
plot(x,z)

  0 Comments

Sign in to comment.

1 Answer

KSSV
Answer by KSSV
on 15 Jul 2019
 Accepted Answer

x=[1 2 3];
y=[1.22 3.31 1.91];
xx = min(x):0.1:max(x);
yy = spline(x,y,xx);
plot(x,y,'r',xx,yy,'b')

  0 Comments

Sign in to comment.