how to find the inner values between two integer value
1 view (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
KSSV
on 30 Nov 2021
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')
More Answers (0)
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!