??? Index exceeds matrix dimensions.

2 views (last 30 days)
raj
raj on 22 Mar 2012
Actually I am trying to plot the local maxima on a data which is a matrix but i get this error '??? Index exceeds matrix dimensions.' here is my code
surf(T,f,G'), shading interp
[Gmax,imax,Gmin,imin] = extrema2(G);
hold on
plot3(T(imax),f(imax),Gmax,'bo')
for i = 1:length(Gmax)
text(x(imax(i)),y(imax(i)),zmax(i),[' ' num2str(zmax(i))])
end
hold off
the error is in the line ' plot3(T(imax),f(imax),Gmax,'bo')' how can i change the size of the vector T ad imax is very large this is what creates the problem. The extreme2 function can be found in this link 'http://www.mathworks.com/matlabcentral/fileexchange/12275'

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!