## Battery made of quarters

## Matlab stuck "Initializing"

This week I had an issue with MATLAB failing to start in the Electrical Engineering computer labs at Ohio State. It simply opened the Matlab window and said it was Initializing (image on right), but hung there indefinitely. This turned out to be even more frustrating than when I have problems at home due to the combined hurdles of the altered path of Matlab files and restrictions on certain user actions.

The problem is similar to the one described by The Mathworks here:

http://www.mathworks.com/support/solutions/data/1-2Z18MA.html?solution=1-2Z18MA

I did not expect that I could fix the problem as a non-administrative user, but it turns out to be possible so I describe the method here.

As The Mathworks says somewhere down the list of their possible solutions, the “Mathworks” folder needs to be deleted from the “Application Data” folder to resolve the issue. To do this in the ECE labs:

Step 1: Make sure Matlab is closed

Step 2: Navigate to the Application Data folder

– Go to My Computer >”home on ‘EMC-SNAS:T5.5.28.1 (hiro)'” (Z-drive)

– Open the Application Data folder

– Delete the Mathworks folder

— (The files in Z:\Application Data\MathWorks\MATLAB\R2007a need to be deleted)

Step 3: Restart Matlab

– The issue should be resolved.

I made a batch file (*.bat) to automate this process. Download it here.

To be able to run the script, you must open it in Winzip and execute it from there. You cannot extract it before running it due to permissions.

## Graphical Calculation of Gain and Phase of a system in the S-Domain

Today I’d like to record some observations from ECE351, Systems I, taught by Professor Hooshang Hemami of the Electrical Engineering department at The Ohio State University.

First, I will note what H(s) is before showing how to use it to calculate the gain and phase of a system.

H(s) is the transfer function of a system. For any s=σ+jω, H(s) is the relationship between X(s) (the input) and Y(s) (the output).

The zeros of H(s) are found at roots where H(s) = 0.

The poles of H(s) are found at discontinuities of H(s), where H(s)=±∞

The numerator of H(s) is made up of a product of zeros: (s-zero1)(s-zero2)

The denominator of H(s) is made up of a product of poles: (s-pole1)(s-pole2)

The gain and phase of the transfer function are found using the frequency response H(jw).

The gain is the magnitude in the complex plane of H(jw)’s numerator / H(jw)’s deniminator.

The phase is the angle in the complex plane of H(jw)’s numerator – H(jw)’s denominator.

The gain and phase can be calculated graphically on a pole-zero diagram. I expect to post example images in the future.

For the gain, this is done by finding the resultant distance between the zeros and the frequency of interest, then dividing by the distance from the poles to the frequency of interest.

The phase is found by finding the angle between the frequency of interest and the zeros, then subtracting the angle between the frequency of interest and the poles of H(s) in the complex plane.

An interesting case for this graphical method is analysis at discontinuities or zero values. Note that 0 in the complex plane has no magnitude or direction angle, so it cannot be used to calculate the gain and phase. Limits approaching the point along the jw axis must be used.

That’s all for now. I may post example images and more detail in the future, as I mentioned.