linear Interpolation using matlab

Hi,
I am trying to interpolate using if loops. The time is in 30min intervals for 24hrs. I have attached the txt file that I am using, i have read the file in using
fid= fopen('ifng.txt','r');
format longg;
A = textscan(fid, ['%s', repmat('%f', 1 , 25)], 'HeaderLines', 1);
e= [A{2:end}];
So far I have
if(t<30)
{E=((t-t0)/(t1-t0))*e1-((t1-t)/(t1-t0)e0)}
elseif(t<60)
{E=((t-t1)/(t2-t1))*e2-((t2-t)/(t2-t1)e1)}
end
I am just wanting to know if I am along the correct lines or if I have missed out any steps. I know that the code isn't finished but just checking of I'm along the right lines as I am new to matlab.
Thanks

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Asked:

on 6 Jul 2016

Edited:

dpb
on 6 Jul 2016

Community Treasure Hunt

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

Start Hunting!