How can I smooth a surface in MATLAB? -


i have surface in matlab plotted using following code:

[xi, yi] = meshgrid(s/k, days); vq = griddata(s/k, days, rbf/k, xi, yi,'natural'); mesh(xi,yi,vq) 

the resulting image quite rough, , has lots of grid lines there 200 data points in each vector. possible plot mesh has smaller number of grid points (e.g. 20) averages out existing meshgrid, griddata surface?

one option use conv2 on vq data smooth, downsample @ander suggested:

n = 5; % averaging size vq_2 = conv2(vq, ones(n)/n.^2,'same'); mesh(xi(1:20:end,1:20,end),yi(1:20:end,1:20,end),vq_2(1:20:end,1:20,end)) 

there bit of edge effect default conv2 pads zeros.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -