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

 採用された回答

KSSV
KSSV 2021 年 11 月 30 日

0 投票

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')

1 件のコメント

Arif Hoq
Arif Hoq 2021 年 11 月 30 日
got the interpolated points. thank you very much @KSSV

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

タグ

質問済み:

2021 年 11 月 30 日

編集済み:

2021 年 12 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by