How to code a dot product algorithm?

preview_player
Показать описание
We develop an algorithm to calculate the dot product between column vectors

00:00 -Introduction
00:06 -The mathematical definition of the dot product
00:51 -Visualize the dot product in terms of the individual entries
01:30 -Pseudo-code algorithm to calculate the dot product
02:14 -How would are algorithm change if inputs are row vectors?
02:30 -Create a sandbox script file to play with the dot product
02:51 -Initialize vector size and two input vectors
03:24 -Use MATLAB’s dot product function
04:00 -Code up our own dot product algorithm
04:42 -Initialize our output to prepare for first iteration of for loop
04:50 -Analyze the behavior in each loop iteration
05:40 -Compare our algorithm output to MATLAB’s dot product function
05:58 -Challenge 1: How can we adapt this to handle row vectors?
06:09 -Challenge 2: How to make this independent of column or row vectors?
06:20 -Difference between an algorithm, pseudo code, and production code
07:00 -Conclusion
Рекомендации по теме
Комментарии
Автор

Challenge 1:
I think that in order to change to a row vector, you could alter *x = ones(1, m)* and y = *2ones(1, m)* . In the for loop you would switch the index in the variables as well to be *x(1, i)* and *y(1, i)* .

Challenge 2:
If a matrix only has one dimension, I believe you can also just do *x(i)* and *y(i)* and it would give you the entry of the ith row or ith column of the vector.

HotRodster
visit shbcf.ru