To compute the determinant of a matrix in Matlab, you can use the det
function. Here's how you can write the problem1.m
script:
main.m73 chars5 lines
This script first defines the matrix a
and the vector b
. Then it computes the determinant of a
using the det
function and stores the result in the variable d
. Finally, it outputs the value of d
using the disp
function.
If you run this script in Matlab, you should see the value of the determinant printed to the console.
gistlibby LogSnag