Jump to content

Need help with MULTISIM / MATLAB


EnterTheVoid

Recommended Posts

Help, I haven't used these two programs in a long time and I forgot some basic commands that I used to know. 1. I simulated the circuit in Multisim. I saved the oscilloscope data in a text file and I want to get MATLAB to read in the text file and plot the graphs [2 in all; voltage versus time for channel A and voltage versus time for channel B]. 2. Is it possible to measure the current waveforms on oscilloscope in Multisim ? I don't want to simply read the current values off the multi meter but actually view the current graph on the oscilloscope. I have attached a text file. Now, how the **** do I get Matlab to read this file and produce a plot of Channel A voltage versus time and Channel B voltage versus time ? Just the Matlab commands should suffice and refresh my memory for I haven't done this in a long, long time.

Link to comment
Share on other sites

Help, I haven't used these two programs in a long time and I forgot some basic commands that I used to know. 1. I simulated the circuit in Multisim. I saved the oscilloscope data in a text file and I want to get MATLAB to read in the text file and plot the graphs [2 in all; voltage versus time for channel A and voltage versus time for channel B]. 2. Is it possible to measure the current waveforms on oscilloscope in Multisim ? I don't want to simply read the current values off the multi meter but actually view the current graph on the oscilloscope. I have attached a text file. Now, how the **** do I get Matlab to read this file and produce a plot of Channel A voltage versus time and Channel B voltage versus time ? Just the Matlab commands should suffice and refresh my memory for I haven't done this in a long, long time.
1) Yes, as long as the text file is configured in matrix/array format. Save the textfile in MATLAB's workspace, or provide the full path to the textfile and use the fopen command to read it into a vector. To plot, you'll need to read in content from your text file into variables and then plot them manually. When I used MATLAB for electric circuit I don't remember a function to read data and then automatically plot it. You can use textscan -> Voltage = textscan(file, '%d') then use the plot function to plot against time 2) I doubt it. In PSPICE/OrCAD it was always reading the values off the multimeter and plotting in Excel. Maybe in an updated version there's some interface where this is possible.
Link to comment
Share on other sites

Thanks Zap and Shehezadda very much for your help, it is very much appreciated For illustration purposes, suppose I want to simulate the following half wave recitifer with a resistive load, as shown in the diagram below; also indicated are the two waveforms seen on the CRO halfwaveresistive.jpg Now, I have saved the CRO data in a text file, which I have called half wave resistive, and I want Mat lab to read the data and produce the exam same plot that Multisim gave. I distinctly remember doing this but I have forgotten the syntax for doing so; how does it go ? I forgot how Matlab reads data, row by column, column by row, whatever. Do you remember the syntax ? load ('filename.txt') .... ..... plot(x,y) The text file just contains a whole heap of numbers, of which the following is a sample. ******************************************************************************** Column 1 Time (S) Column 2 Channel_A Voltage(V) Column 3 Channel_B Voltage(V) Time Channel_A Channel_B -------------------------------------------- 0.000000000000e+000 0.0000e+000 -7.4104e-003 3.613381899553e-006 4.2323e-011 2.5510e-002 1.361338189956e-005 1.0147e-009 1.1662e-001 2.361338189957e-005 3.0952e-008 2.0772e-001 3.361338189958e-005 1.0417e-006 2.9882e-001 4.361338189959e-005 3.5216e-005 3.8992e-001 5.361338189960e-005 1.1413e-003 4.8102e-001 6.361338189961e-005 1.9220e-002 5.7211e-001 7.361338189962e-005 7.5067e-002 6.6320e-001 8.361338189963e-005 1.4850e-001 7.5427e-001 9.361338189964e-005 2.2843e-001 8.4535e-001 1.036133818997e-004 3.1131e-001 9.3641e-001

Link to comment
Share on other sites

follow the link i gave u. That shd do the job. 1st delete the header in your text file so that the file contains only the numbers. fid = fopen('filename.txt','r'); [A,x,y] = fread(fid); plot(A,x); plot(A,y); fclose(fid); A is 1st column matrix and so on I dont have matlab now at home so cannot verify the syntax. I am very bad at that and use matlab only once in a while for complex sim.But if you type the command in matlab prompt, you shd get help, for example, > help fread.m >help fclose.m

Link to comment
Share on other sites

Bring it on. Why private..? Koi aavat hai' date=' koi jaavat, jo khul ke saamne aaye, vahi mallika sherawat hai :yay:[/quote'] What ? I'm sorry, but I don't follow. I need to display my results pictorially in that form using Matlab's mesh function. I have read Matlab's doc / help files, but they don't help. Tried asking my class mates, to no avail. Problems with the syntax or some shyt, I don't know. I mentioned private as I was hoping to get this done over MSN or something similiar, due to the time differences. Due on Monday. Date / Time now in Adelaide / Australia is Saturday, September 12th, 3:48 P.M. If you can help, please do, would greatly appreciate it.
Link to comment
Share on other sites

^ :lol: Undergraduate, mate. Just an assignment question. Assignment due on Monday. The two queries were for different assignments from different courses. 1 => power electronics; 2nd => DSP
I was talking to flamy. On your question, i have never used mesh but could have seen the command if you had asked that during the weekdays. I am at home and don't have matlab at home. So cannot log into matlab to check how mesh works. My advice would be to search for example/programs that use mesh on the internet. For matlatb, there are usually a lot of programs on net.
Link to comment
Share on other sites

Whoa that link is awesome. Thx Shehezaada. Nice to find some VLSI brethren around here. You know any more resources other than opencores and asic-world? Thx sree for starting the thread :P
sure...he's my prof but there's many more guys interested at this in my university. Here's a link to another guy...I'm taking Real Time with him right now. http://www.soe.uoguelph.ca/webfiles/rmuresan/
Link to comment
Share on other sites

×
×
  • Create New...