Index exceeds matrix dimensions error in matlab -


this question has answer here:

i error

index exceeds matrix dimensions

when run following in matlab. doing wrong?

>>  =       1     2     3      4     5     6      7     8     9  >> a(:)  ans =       1      4      7      2      5      8      3      6      9   >> sum(a(:))  index exceeds matrix dimensions.  >> sum(a(:),1)  index exceeds matrix dimensions.  >> sum(a(:),2)  index exceeds matrix dimensions. 

you did set variable under name sum

a = [1 2 3 ; 4 5 6; 7 8 9] sum = 1;   >> sum(a); index exceeds matrix dimensions.   clear sum; >> sum(a)  ans =      12    15    18 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -