Interpolation using data from excel sheet
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ranish Sharma
el 17 de Abr. de 2024
Respondida: Mathieu NOE
el 17 de Abr. de 2024
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!
0 comentarios
Respuesta aceptada
Mathieu NOE
el 17 de Abr. de 2024
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)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Multidimensional Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!