??? Index exceeds matrix dimensions.

1 次查看(过去 30 天)
raj
raj 2012-3-22
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'

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by