Matlab library by Rico Picone, PhD.
I'm using this as my general Matlab utilities repo. Mostly I write Matlab functions for dynamic systems analysis, control systems design, and graphics interaction with LaTeX and tikz.
Download or clone this repo. In an m-file, add the matlab-rico/rico directory to your Matlab path as follows.
addpath('WHEREVER-YOU-PUT-IT/matlab-rico/rico')Now you should have the matlab-rico library functions and classes available.
Download the rico Toolbox file and open it in Matlab (usually a double-click on the file will work). Before it will work, you have to add the installation directory to your Matlab Path. First, open the menu Home > Add-Ons > Manage Add-Ons.
Right-click on Toolbox rico and select Open Folder.
Click the file path <toolbox path> in the address bar, selecting it.
Copy it. In the Command Window, paste it into the following command.
addpath(genpath(<toolbox path>))Still in the Command Window, lock it in for the future.
savepathSometimes I forget to update the Toolbox, so be warned that it may be out-of-date.
Make a phasor or two!
p1 = phasor('pol',3,pi/2); % polar form
p2 = phasor('rec',4,5); % rectangular formNow try some phasor arithmetic.
p3 = p1 + 2*p2
p4 = p1*p2Check out the polar and rectangular forms of the results.
p3.pol
p3.rec
p4.pol
p4.recIt also works with symbolics.
syms x y real
p5 = phasor('rec',x,y);
p6 = 3*p5^2;
p6.polThis returns the following.
[ 3*x^2 + 3*y^2, 2*atan2(y, x)]Cool, huh?
The documentation is included in the docs directory. Specifically, see docs.pdf. The function and class files are in the rico directory and some of them include their own documentation, which can be accessed using help or doc as usual. For instance, we can see the included class documentation for the phasor class as follows.
help phasor