How to code a scalar-vector multiplication function?
We write a dscal function in MATLAB to scale a vector x by a constant alpha.
00:00 -Introduction
00:17 -Mathematical definition of scalar-column-vector multiplication
00:59 -Pseudo-code algorithm for scalar-column-vector multiplication
01:37 -Mathematical definitions for scalar-vector multiplication
02:18 -Recall our code to test the scalar-column-vector multiplication algorithm
02:45 -Key Question 1: How to transform an algorithm into production-level code?
03:11 -Key Question 2: How to transform math definitions into a function?
04:44 -Key Question 3: How do we produce the specifications for a function?
05:16 -Key Question 4: How do I generate my own specifications?
05:29 -Create a blank script file and a function file
06:58 -Document the script file
08:35 -Save the file using the proper name (dscal.m) for our function file
09:45 -Document function file with help information for the dscal function
10:45 -Best practice 1: start by documenting the purpose and specifications
11:06 -Best practice 2: explore algorithm separately from writing production code
11:45 -Document the function
13:25 -LAPACK Users guide, Netlib repository, and LINPACK Users guide
14:13 -Start writing executable code: check the number of inputs
14:36 -Use the nargin function to check input arguments
15:29 -Error check for two inputs
17:39 -Error check for nonempty inputs
22:20 -Error check for double precision data
26:56 -Error check that first input alpha is a scalar
29:28 -Best practice 3: Do error checks on the desired input types
30:26 -Error check that second input x is a vector
35:02 -Best practice 4: Verify each new line of code as you write
36:46 -Implement algorithm and verify output
45:36 -Visualize the core algorithm for the dscal function
47:08 -Community Challenge: What caught your attention in this work?
47:35 -Conclusion
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How to code a scalar-vector multiplication function?», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.