Interpolation using data from excel sheet

6 次查看(过去 30 天)
I have a excel sheet(attached) which has imformation on the latitude , month and Monthly Average Daily Extraterrestrial Radiation. from this excel sheet i would like matlab to read it and show me option, which is latitude and month and according to the month and latitude chosen the code should use interpolation and give an answer for the Monthly Average Daily Extraterrestrial Radiation.
Help please??
Thanks!

采纳的回答

Mathieu NOE
Mathieu NOE 2024-4-17
hello
I interpreted your request as : pick one month (from 1 to 12) then define whatever latitude query , and do the interpolation
this boils down to make a 1D interpolation on the column that matches which month you're sking for (I didn't expect someone to ask for month = 3. 1548 for example, in my understanding the month "number" is always an integer)
data = readmatrix('rad data.xlsx',"NumHeaderLines",1);
lat = data(:,1); % latitude data
rad_data = data(:,2:end); % radiation data is an array which columns are the 12 months averages
% define which month
month = 3;
rad_data_this_month = rad_data(:,month);
% interpolate this array vs latitude query
lat_query = 86; % must be within -90 / +90 range
rad_data_int = interp1(lat,rad_data_this_month,lat_query)
rad_data_int = 2

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by