given the matrix a = [ 1 -1 3; -1 2 5; 3 0 -4] and the vector b=[ 1; 0; -2], write a matlab scritp named problem1.m that computes the determinant d of the matrix a in matlab

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.m
a = [1, -1, 3; -1, 2, 5; 3, 0, -4];
b = [1; 0; -2];
d = det(a);
disp(d);
73 chars
5 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.

related categories

gistlibby LogSnag