error code "Index in position 2 exceeds array bounds (must not exceed 2)."
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!