Clear Filters
Clear Filters

From workspace as a voltage source?

15 views (last 30 days)
I would like to use a .mat file as a signal for a circuit with resistors and inductors. it's possible? I took a signal from workspace which is a waveform with harmonics and I would like to connect my active shunt filter to that signal to attenuate the harmonics. Is there any way to do this?

Answers (1)

Sai Sasank Kota
Sai Sasank Kota on 1 Dec 2021
Hi,
I assume you have magnitude and the corresponding time data of the signal in a MAT-file. To generate a voltage of your interest you can use Controlled Voltage Source Block with Signal Editor Block in Simulink as an input. You can import your MAT-file in to the Signal Editor Block. For this, you need to modify your MAT-file slightly as shown in the following code:
magnitude=[1 2 3 4];% Assume these values are for the magnitude of the signal, you need to replace these values with your signal magnitude
time=[0.1 0.2 0.3 0.4]; % Similarly time data
timeSeriesData=timeseries(magnitude,time); % Create time series data
dataSet=Simulink.SimulationData.Dataset(timeSeriesData); % Create Simulink data set
save('matFile.mat','dataSet');% Save it to MAT-file
Once you modify your MAT-file in the above fashion, import the MAT-file to the Signal Editor Block and give this as an input to your Controlled Voltage Source Block.
The following documentation may help
Hope this helps,
Sai Sasank Kota

Categories

Find more on Electrical Sensors in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!