Spectrum Software
spacer
Industrial Strength Simulation
select:

divider

 

 

divider

 

Exporting data to MATLAB

 

Exporing data to MATLAB is also relatively easy. The steps in the process are these:

1) Run Micro-Cap and create a numeric output file with the curve or waveform you want in a text file. Typically this will be a file named Mycircuit.tno or Mycircuit.ano for AC analysis. You must save the waveform or curve in 'bare' format which means a table with data only; no extraneous text including headers. Here are the necessary settings for the Properties (F10) / Numeric Output panel.


Properties. Numeric Panel settings


2) Run the analysis.

3) Press F5 to view the Numeric Output file.

4) Press F10. Specify Not Spice. This eliminates the extra line at the bottom of the text file,"Spicetype=PSpice".

5) Save the output file as Myfile.out to make it distinct from the Myfile.tno file.

6) Run MATLAB. Type in these statements:

load c:\mc11\data\Myfile.out
x = Myfile(:,1);
y = Myfile(:,2);
Plot(x,y)


What you'll see then is a MATLAB plot displayed in a separate window that looks something like this:


MATLAB plot of Micro-Cap data


This procedure is derived from a tutorial at:

http://web.cecs.pdx.edu/~gerry/MATLAB/plotting/loadingPlotData.html#loadCommand

which you can consult for more information.

A more elaborate procedure that can accept column names is described here:

http://www.tutorialspoint.com/matlab/matlab_data_import.htm

 
Download Summer 2014 Circuit Files
Return to the main Newsletter page