error code "Index in position 2 exceeds array bounds (must not exceed 2)."
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!