フィルターのクリア

Interpolation using data from excel sheet

4 ビュー (過去 30 日間)
Ranish Sharma
Ranish Sharma 2024 年 4 月 17 日
回答済み: Mathieu NOE 2024 年 4 月 17 日
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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by