how to find the inner values between two integer value

hello,
facing problem to find the inner values between 2 integer. please have the attached file.
1. at 6am power is 30 and at 7am power is 180.
i want to find the value between 30 and 180 with a timestep 0.05.
like:
6 30
6.05 ???
6.1 ???
6.15 ???
6.2 ???
6.25 ???
6.3 ???
6.35 ???
6.4 ???
6.45 ???
6.5 ???
6.55 ???
6.6 ???
6.65 ???
6.7 ???
6.75 ???
6.8 ???
6.85 ???
6.9 ???
6.95 ???
7 180

 Réponse acceptée

t = [6 7] ;
p = [30 180] ;
% interpolation
ti = t(1):0.05:t(2) ;
pi = interp1(t,p,ti) ;
% plot
plot(t,p,'*r',ti,pi,'-b')
legend('original','interpolation')

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by