Filter löschen
Filter löschen

From workspace as a voltage source?

16 Ansichten (letzte 30 Tage)
Poliana Rockenbach Mendes
Poliana Rockenbach Mendes am 5 Nov. 2021
Beantwortet: Sai Sasank Kota am 1 Dez. 2021
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?

Antworten (1)

Sai Sasank Kota
Sai Sasank Kota am 1 Dez. 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

Kategorien

Mehr zu Simscape finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by