Code covered by the BSD License  

Highlights from
Read ngspice MOD

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 2.79 KB File ID: #24221

Read ngspice MOD

by KBT WARKBT

 

20 May 2009 (Updated 09 Jun 2009)

MOD of the original 'Read ngspice' to make it work on rework-18 the one that comes in fc-10 repo.

| Watch this File

File Information
Description

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

Note: complexity and compatibility increased but performance decreased in other to make it more flexible for further changes.

sim = ReadSpice(filename,varargin)
 
  sim is a cell array that contains all simulations: name,
  data and labels. Like: sim{i} = [name data labels]. For
  extracting data use:
  name=sim{i}(1,1);name=name{1};
  data=sim{i}(1,2);data=data{1};
  labels=sim{i}(1,3:end);
  where i can take values from 1 to length(sim)
  name (to view the simulation name given by ngspice)
  data (to view the numerical data)
  labels (to view how the data is labeled)
 
  This script has been tested on raw (-r out.raw) data from
  ngspice-rework18.
 
  Usage example:
  sim = ReadNGSpice('out.raw');
  sim = ReadNGSpice('out.raw','version','18');
  name=sim{1}(1,1);name=name{1};
  data=sim{1}(1,2);data=data{1};
  labels=sim{1}(1,3:end);
  plot(data(1,:), data(6,:));
  title(name);
  ylabel(labels{6});
  xlabel(labels{1});
 

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Read ngspice

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
21 May 2009

Removed license and added acknowledge to original author

21 May 2009

Added more validation.

22 May 2009

Validation structure changed. RFC for rework-17 and 19.

09 Jun 2009

Corrected bug while reading complex data

Tag Activity for this File
Tag Applied By Date/Time
ngspice KBT WARKBT 21 May 2009 11:04:15
fedora KBT WARKBT 21 May 2009 11:04:19

Contact us at files@mathworks.com