From workspace as a voltage source?

15 次查看(过去 30 天)
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?

回答(1 个)

Sai Sasank Kota
Sai Sasank Kota 2021-12-1
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

类别

Help CenterFile Exchange 中查找有关 Electrical Sensors 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by