I have a file that plots results from a simulation. Ive been using it for a long time and now it has started giving me this problem:
Index exceeds matrix dimensions.
Error in Plot_Results (line 210)
title('Velocity of cycle')
The first time I run the file it works fine. But if I run it again without changing anything (and there is nothing to clear any variables in the code) it gives me that error. If I comment out every title, xlabel, and ylabel line then itll work fine and will plot the several plots I have in the file but with no titles or anything. This just started happening and I cant figure out why. The code was working just fine before this randomly started happening.
thanks

 채택된 답변

Will
Will 2012년 2월 20일

30 개 추천

Alright I figured it out. For some reason it wasnt rewriting the title variable from an old run so i just added "clear title xlabel ylabel" and that seems to have fixed it.

댓글 수: 11

Kiniena
Kiniena 2014년 12월 18일
Thanks
Marlon Saveri Silva
Marlon Saveri Silva 2015년 8월 14일
Thanks o/
Ivailo
Ivailo 2016년 1월 19일
Thanks
Ian Adler
Ian Adler 2016년 6월 23일
Thank you so much
shir shalom
shir shalom 2017년 2월 11일
Thanks!
Thomas Gurnett
Thomas Gurnett 2017년 3월 4일
Cheers
Rania Ezzo
Rania Ezzo 2017년 4월 22일
Thank you. This was helpful.
Edward McCarthy
Edward McCarthy 2017년 10월 2일
This worked for me
Jennifer Scoular
Jennifer Scoular 2018년 6월 21일
Was getting mega frustrated and this worked thanks!
Bahare Samadi
Bahare Samadi 2018년 11월 30일
Thanks. It was very helpful.
Mariana Rodrigues
Mariana Rodrigues 2019년 1월 17일
Thank you!!

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Qiu
Qiu 2018년 2월 23일

2 개 추천

I just found that I accidentally used the name "title" for a string, which confused Matlab. Try use another name.
Jacob Wicks
Jacob Wicks 2019년 1월 10일

2 개 추천

I had made xlabel and ylabel a variable which gave me the error about index exceeds array.
xlabel = ('time')
ylabel = ('something')
all I had to do was clear these variables
>>clear xlabel
>>clear ylabel
and use the proper syntax
xlabel('time')
ylabel('something')
Haseeb Ahmed Janjua
Haseeb Ahmed Janjua 2017년 9월 27일

0 개 추천

whenever I create this function in editor
function r = Ymaxfinal(p,q)
r = ((-1000*p*q)/(27*(30*10^6)*0.163*(p+q)))*(p+(2*q))*((3*p(p+(2*q)))^0.5);
end
but when I call it in command window like Ymaxfinal(9,8)
it gives the error of Index exceeds matrix dimensions. plz help me

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

태그

질문:

2012년 2월 20일

댓글:

2019년 1월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by