Interpolation using Excel Data
19 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Star Strider
2023 年 8 月 18 日
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!