I currently have the below as my function that I created to try and find the product of any matrix A. When I run the function, it keeps telling me that B is not inside any function. I don't know if I should change my function or what else I should do to fix the problem.
function prod=MatProd(A) prod=1; [m,n]=size(A); for i=1:1:m for j=1:1:n prod=prod*A(i,j); end endendB=[12.2, 1.2, 2.4; 2,3,4; 2.5, 6.2,3.4];MatProd(B)
Best Answer