Interpolation using Excel Data
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Veronica Vigil
el 18 de Ag. de 2023
Comentada: Star Strider
el 19 de Ag. de 2023
Hello. Newb here. I have a set of data in Excel (attached) that I would like to plot and interpolate and show the below and after plots (before interpolation and after). I have tried to follow various examples on interpolation, but am having a hard time understanding how to use my data in the code itself since I have an array of various answers. Right now my table is in 10s, and I want to interpolate the values between 10 and 20, 20 and 30,etc for inclination, and 300 and 310, etc for each.
I tried to see if I can figure out how to just interpret between the each and then manually enter into excel, but I'm having trouble here too.
What I'd REALLY love is all the values interpolated based on the data I have an plot the before (not interpolated) and after (after interpolation) on a 2D meshgrid.
Help??
thanks!
Veronica
0 comentarios
Respuesta aceptada
Star Strider
el 18 de Ag. de 2023
One approach —
% C1 = readcell('FluxData.xlsx')
T1 = readtable('FluxData.xlsx')
xvar = T1{1,3:end};
yvar = T1{2:end,2};
A = T1{2:end,3:end};
figure
surf(xvar, yvar, A)
colormap(turbo)
colorbar
xlabel('Inclination')
ylabel('Altitude')
zlabel('Flux')
[Xu,Yu] = meshgrid(xvar, yvar);
interpv = 5;
xq = linspace(min(xvar), max(xvar), numel(xvar)*interpv);
yq = linspace(min(yvar), max(yvar), numel(yvar)*interpv);
[Xi,Yi] = meshgrid(xq,yq);
Ai = interp2(Xu,Yu,A,Xi,Yi);
figure
surf(Xi, Yi, Ai)
colormap(turbo)
colorbar
xlabel('Inclination')
ylabel('Altitude')
zlabel('Flux')
.
7 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!