From workspace as a voltage source?
16 ビュー (過去 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?
0 件のコメント
回答 (1 件)
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
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!