- I don't think this is what you want, but if you just want to plot the maximum you can use contourslice, i.e.
...zeroPoints =...% start added code
max_val = max(max(eval(DoG3DFit(X(1:100:end,1:100:end),Y(1:100:end,1:100:end)))));[xmesh,ymesh,zmesh] = meshgrid(-1000:1000, -1000:1000,[0 max_val]);V = matDoG3DFit(xmesh, ymesh);hold oncs = contourslice(xmesh,ymesh,zmesh,V,[],[],max_val,[max_val max_val]);cs(1).EdgeColor = 'red';cs(1).LineWidth = 3;% end added code
subplot(2,2,3) ...
- But from your question it looks as if you want to be able to generate an analytical solution.Doesn't the original (2D) method still work? I think at the 'caldera' both dz/dx = 0 and dz/dy = 0.So if you find either of these derivatives, you can find the maximum/minimum.Offcourse these derivatives are a bit more complicated..
Hope this helps.
Best Answer