how to find the inner values between two integer value
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
KSSV
2021-11-30
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')
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!