No BSD License  

Highlights from
Read ngspice

3.66667

3.7 | 3 ratings Rate this file 6 Downloads (last 30 days) File Size: 1.67 KB File ID: #23095

Read ngspice

by Madison McGaffin

 

24 Feb 2009

Loads data from ngspice simulations into MATLAB

| Watch this File

File Information
Description

% [Data, Labels] = ReadSpice(filename)
%
% Data is an MxN matrix containing the values of the M variables
% at each of the N datapoints.
%
% Labels is a M-vector with the Mth label corresponding to the
% Mth row in Data
%
% This script has been tested on raw (-r Out.raw) data from
% ngspice-rework17.
%
% Usage example:
% [data, labels] = ReadNGSpice('out.raw');
% labels (to view how the data is labeled)
% plot(data(1,:), data(6,:));
% title('Oscillator Output (V)');

Acknowledgements
This submission has inspired the following:
Read ngspice MOD
MATLAB release MATLAB 7.7 (R2008b)
Other requirements ngspice rework17
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
02 May 2009 Mehmet Ali An1l

I guess the code doesn't wiork with ngspice rework 19.
e.g.

>> [data,labels] = ReadNGSpice('rawfile.raw')
??? Error using ==> ReadNGSpice at 51
Assertion failed.

rawfile.raw is read by ngnutmeg.

18 May 2009 KBT WARKBT

I modify the script to work on ngspice rework 18 the one that comes with fc10:

http://www.mediafire.com/?mj2jn3k52iz

I removed assert instructions to keep some backwards compatibility, and modify the way to read data + minor details.

At least for me ,it works ...
Hope it helps someone

13 Jan 2010 Jas Condley

Updated the regular expressions. The built-in assert in newer versions of matlab seems to mess things up too, so use of the assert file found here is necessary.

Updated files can be found at:
http://users.soe.ucsc.edu/~jas/matlab-ng/

This works with the raw output of ngspice-19

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
spice Madison McGaffin 25 Feb 2009 13:31:05
simulation Madison McGaffin 25 Feb 2009 13:31:05
ngspice Madison McGaffin 25 Feb 2009 13:31:05
data import Madison McGaffin 25 Feb 2009 13:31:05

Contact us at files@mathworks.com