MATLAB function to plot Instantaneous Voltage, Current and Power

Hello Friends, Today I had an exam in a Power System Course, so just got little excited about Power System and related analysis in MATLAB.

In this post, I want to share with you a very basic MATLAB function which I created recently. Given the values of Voltage and Impedance, this function can plot the graphs of Instantaneous Voltage, Instantaneous Current and Instantaneous Power.

The MATLAB code is given below. Alternatively you can download the M-file for the function from here:

Just download the zipped file, unzip it and open the 'graph.m' file. If your MATLAB console's current directory is set to the folder in which the graph.m file is present, then you can also view the syntax and explanation of this function by typing