Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

How to plot a graph between two variables using interpolation method????

Asked by amrinder

amrinder (view profile)

on 19 May 2013

hello all, There is this simple problem i am facing.I am plotting a graph between 't' (time) and 'e'(Energy) which gives me the values of energy at specific time.

I want to plot the interpolation graph between these two variables such that instead of getting specific bars of energy at specific time, i get a continuous signal graph.

SCRIPT IS:

 figure()
 plot(t(1:n),e);

THANX.....

0 Comments

amrinder

amrinder (view profile)

Products

No products are associated with this question.

2 Answers

Answer by Image Analyst

Image Analyst (view profile)

on 19 May 2013
Accepted answer

You can use splines, as I show in my demo: http://www.mathworks.com/matlabcentral/answers/75657#answer_85307

0 Comments

Image Analyst

Image Analyst (view profile)

Answer by the cyclist

the cyclist (view profile)

on 19 May 2013

You can interpolate with the interp1() function.

0 Comments

the cyclist

the cyclist (view profile)

Contact us