Stuart’s MATLAB Videos

Watch and Learn

Basics: Implementing a formula in MATLAB

This video will demonstrate how to implement a formula in MATLAB. In the video, we will make a function out of the formula. The function will take a scalar (single number) or a vector. We want to make the function take either a scalar or a vector so that you do not have to loop through calling the function. This is not for speed, but for the simplicity and readability of the code. This vectorization is done by means of array division ( ./ ) and array multiplication ( .* ). These operations do division and multiplication on an element by element basis.
  • print


要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。