Just a few of the practice exercises to familiarize ourselves with Matlab and the syntax it uses:
Here is an example of creating vectors, matrices, and different math functions using them.
This is an example of using Matlab's plotting functions. These include plotting multiple graphs in one figure, changing the look of each graph, and holding plots in order to add more to the figure later.
Solving Simultaneous Equations
Here I used Matlab in order to solve a system of linear equations in a script file. We were given a circuit with two loops and asked to find the value of the net current that flows through the middle resistor. I set up the system of equations by hand, and once I had the coefficients of the system I was able to create the two matrices above. Using Matlab's Gaussian Elimination function '\', I was able to solve for the current in each loop. I then assigned (the current through R3) currentI3 the difference between the two currents. Correct answer -0.186 A.
Plotting Exponentials
Adding Sinusoids





No comments:
Post a Comment