error code "Index in position 2 exceeds array bounds (must not exceed 2)."
Mostrar comentarios más antiguos
i keep getting this error code, i know something in my matrix must be wrong, also my output must be a matrix
function z = matrix_mult(X,Y)
[x,y]=size(X)
[x1,y1]=size(Y)
for i=1:y % col
for j=1:x1 %row
z(i,j)=X(i,j)*Y(i,j)+X(i,j+1)*Y(i+1,j)
end
end
end
im trying to do matrix multiplication with my own funtion instead of the built in funtion in matlab, i get this first number right and then it pops up with this error
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!