??? Index exceeds matrix dimensions.
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!