calculate the dot product of (-3, 5, 1) with (7, 4, 5) in matlab

To calculate the dot product of two vectors (-3, 5, 1) and (7, 4, 5) in MATLAB, you can use the dot() function. Here's how you can do it:

main.m
a = [-3, 5, 1];
b = [7, 4, 5];

dotProduct = dot(a, b);

disp(dotProduct);
75 chars
7 lines

Running this code will output the dot product of the two vectors, which in this case is 14.

Tags: matlab, dot product, vectors

related categories

gistlibby LogSnag