Рет қаралды 1,152
How to import csv data to Simulink ?
How to send csv data to Simulink ?
How to do an FFT analysis on CSV data ?
0:00 - Move/send CSV data to Simulink.
04:04 - Bonus 1 : Perform an FFT analysis of your CSV data
05:34 - Bonus 2 : Plot CSV data into MATLAB
06:43 - End screen
Script :
%This is adapted to my data, change names for yours
%Please remember to check your data’s sampling time or period, you’ll need this into the block “from workspace”
bestVar=timeseries(BestCsvData.ac_current,BestCsvData.time);
tiledlayout(2,2);
nexttile
plot(BestCsvData.time,BestCsvData.ac_current,'r');
legend('Best Ac Current ever')
set(gca,'fontsize',14)
xlabel('time (s)')
ylabel('Current (A)')
title('Best AC Current ever')
grid on
nexttile
plot(BestCsvData.time,BestCsvData.ac_voltage,'b');
legend('Best Ac Voltage ever')
set(gca,'fontsize',14)
xlabel('time (s)')
ylabel('Voltage (V)')
title('Best AC Voltage ever')
grid on
nexttile
plot(BestCsvData.time,BestCsvData.dc_current,'r');
legend('Best DC Current ever')
set(gca,'fontsize',14)
xlabel('time (s)')
ylabel('Current (A)')
title('Best DC Current ever')
grid on
nexttile
plot(BestCsvData.time,BestCsvData.dc_voltage,'b');
legend('Best DC Voltage ever')
set(gca,'fontsize',14)
xlabel('time (s)')
ylabel('Voltage (V)')
title('Best DC Voltage ever')
grid on