When I run this Laplace expansion in Matlab for determinant, I do get "Undefined function or variable 'A'". I will be happy if anyone can help me correct it and make it workable.
function value = Laplace
A=input('matrix A =');
[rows, columns] = size(A);
if rows == 2
for i = 1:rows
value = A(1,1)*A(2,2) - A(1,2)*A(2,1);
end
else
if rows==3:size(A);
for i = 1:rows
columnIndices = [1:i-1 i+1:rows];
value = value + (-1)^(i+1)*A(1,i)*...*Laplace(A(2:rows, columnIndices));
end
end
Thanks