Interpolation using Excel Data
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Veronica Vigil
il 18 Ago 2023
Commentato: Star Strider
il 19 Ago 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 Commenti
Risposta accettata
Star Strider
il 18 Ago 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 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

