I need a picture of a graph similar to the one I posted
4 views (last 30 days)
Show older comments
clear all
clc
T = readtable('data1.xlsx') ;
T = table2array(T) ;
x = T(1,2:end); %
y = T(2:end,1); %
Z = T(2:end,2:end); % use fillmissing to fill NaNs
[X,Y] = meshgrid(x,y) ;
[xq,yq] = meshgrid(2:0.1:10); % grid 0.1
Zq = interp2(x,y,Z,xq,yq,'spline'); % spline
figure
AA = surf(xq,yq,Zq);
title('(spline,cubic,makima) Interpolation Using Finer Grid');
I need a graph that changes this graph to the following shape, regardless of the exact value.
Of course the overall shape should be the same
0 Comments
Answers (1)
Star Strider
on 10 Nov 2021
Add these calls after the surf call —
colormap(turbo)
shading('interp')
The surf plot should then be close to what appears to be the desired result.
T = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/796594/data1.xlsx') ;
% T = table2array(T) ;
x = T(1,2:end); %
y = T(2:end,1); %
Z = T(2:end,2:end); % use fillmissing to fill NaNs
[X,Y] = meshgrid(x,y) ;
[xq,yq] = meshgrid(2:0.1:10); % grid 0.1
Zq = interp2(x,y,Z,xq,yq,'spline'); % spline
figure
AA = surf(xq,yq,Zq);
colormap(turbo)
shading('interp')
title('(spline,cubic,makima) Interpolation Using Finer Grid');
.
0 Comments
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!