MATLAB: Create plot with slice

plotslice

Hi, I am wondering if I have two values
x=[1,2,3,4,5,6,7]
y=[10,20,22,25,30,35,37]
I understand, it does NOT work like that, but could anyone help me to to do the same figure but with the data on the righthand side Y..
I need my plot to look like the same ??

Best Answer

Try this
[X, Y, Z] = meshgrid(0:0.5:20, 0:0.5:20, 1:7);
V = exp(-0.2*sqrt((X-10).^2+(Y-10).^2+(2*(Z-4)).^2)); % based on guess
slice(X, Y, Z, V, [], [], 1:7)
colormap(jet)
shading interp
view([45 10])