Stuart’s MATLAB Videos

Watch and Learn

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the Original version of the page.

Basics: Implementing a formula in MATLAB 5

Posted by Doug Hull,

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.

5 CommentsOldest to Newest

Ismael replied on : 2 of 5
I whould like to know how to show in a GUI window a formula, i mean a formula like the one you have in the first snapshot of this video tutorial, not the graphical representation. And i would like to know which kind of element in the GUI i need to use. Thanks in Advance
dhull replied on : 3 of 5
@Ismael, You can use the TeX and LaTeX parts of MATLAB for some formulas. For the one above, that was just a screenshot of an e-mail the user sent me. Doug