1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Integrating Pspice with matlab (how to import data)

Discussion in 'Circuit Simulation & PCB Design' started by troop123pack, Mar 25, 2017.

  1. troop123pack

    troop123pack New Member

    Joined:
    Mar 25, 2017
    Messages:
    2
    Likes:
    0
    Hello,

    I have written a Pspice program, and simulated transfer and output characteristics. I have it saved as a SPICE DECK EXAMPLE.dat file.

    I am supposed to try to load the data into matlab using command load '.dat' -ascii;

    Please how can I transfer that data into matlab so MATLAB recognises it so I can load the data into MATLAB.

    I have tried to import it into matlab using import data then I wrote the command in matlab but it says Error using load. Unable to read file 'SPICE DECK EXAMPLE.dat': no such file or directory.

    In summary, What's the best process of transferring simulated data from Pspice into matlab?


    George
     
  2. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,041
    Likes:
    541
    Location:
    AZ 86334
    Are you trying to import the Spice circuit description, or the results of a Spice simulation (voltages at nodes vs time). I suspect Matlab could understand the latter, but wouldn't have a clue as what to do with the former...

    Here is how to do it in LTSpice.

    I created a trivial circuit and simulated it.
    I plotted the voltage vs time at node a V(a) and node b V(b).
    I asked LTSpice to export V(a) and V(b) vs time into a text file.
    I show the contents of the text file.

    I'll bet that MatLab could deal with the contents of the text file (I'm not a Matlab user).

    30.png
     
    Last edited: Mar 25, 2017
  3. troop123pack

    troop123pack New Member

    Joined:
    Mar 25, 2017
    Messages:
    2
    Likes:
    0
    I am trying to import the results of a Spice simulation into Matlab, I know how to get the values etc from Pspice but how do I load it up on MATLAB using the load or textread command?
     

Share This Page