From 0aeeca161c38124b99c0c75fd16351642705ce6b Mon Sep 17 00:00:00 2001 From: Warrick Lo Date: Mon, 16 Feb 2026 03:08:14 -0800 Subject: Add MATLAB code for processing data Signed-off-by: Warrick Lo --- phasor.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 phasor.m (limited to 'phasor.m') diff --git a/phasor.m b/phasor.m new file mode 100644 index 0000000..a75cc0e --- /dev/null +++ b/phasor.m @@ -0,0 +1,15 @@ +function phasor(modulus, argument) + % Wrapper for quiver() that plots phasor diagrams. + % + % Expects the modulus and argument (in degrees) + % of a complex number. + + r = modulus; + phi = argument * pi / 180; + + % Automatic scaling is disabled. + quiver(0, 0, r*cos(phi), r*sin(phi), 0); + + xlim([-r r]); + ylim([-r r]); +end -- cgit v1.2.3