from
Matlab <-> PSpice Interface
by Frank Sommerhage
How to call PSpice from Matlab and import the results
|
| test.m |
% just a test
% load some data I recorded and prepared earlier
% Background info:
% The data is mainly a transient artifact to characterize a
% neuron-silicon junction. A cell was cultured on field-effect
% transistors and then stimulated 250 times with a very short
% rectangular voltage puls. The recorded result is what you see.
% The hole thing is not perfect - just a little demo...
load test
% plot the original data
plot(d.Sim.Time, FET, 'k'); hold on
% domo fitting variable, the seal-resistance: 460 kOhm
% I used an evolutionary approach for my parameters (not included),
% but you can add whatever automated fitting-routine you like/need
d.Sim.Rjunction = .46e6;
% prepare a netlist for PSpice 6.0 (an also files with I/V data)
% the seal-resistance is a part of the Point-Contact-Model (PCM)
n = setPCM(d.Sim);
% this is the key-routine, setting simulation parameters, writing
% a circuit file and calling PSpice 6.0 for DOS...
% This is the easiest way for Matlab <-> PSpice interfacing
o = PSpice60(n, [d.Sim.Time(1) d.Sim.Time(end)]);
% plot the simulated data and add a legend - done! :-P
plot(o.Time, -o.Data(:,1), 'g--');
legend({'measured', 'simulated'})
|
|
Contact us at files@mathworks.com