2019-08-22 15:48:47 +02:00
|
|
|
tg = slrt;
|
|
|
|
|
|
|
|
%%
|
2019-09-10 16:05:05 +02:00
|
|
|
% if tg.Connected == "Yes"
|
|
|
|
% if tg.Status == "stopped"
|
|
|
|
% %% Load the application
|
|
|
|
% tg.load('test_cercalo');
|
|
|
|
%
|
|
|
|
% %% Run the application
|
|
|
|
% tg.start;
|
|
|
|
% pause(10);
|
|
|
|
% tg.stop;
|
|
|
|
% end
|
|
|
|
% end
|
2019-08-22 15:48:47 +02:00
|
|
|
|
2019-09-10 16:05:05 +02:00
|
|
|
%%
|
|
|
|
f = SimulinkRealTime.openFTP(tg);
|
|
|
|
mget(f, 'data/data_001.dat');
|
|
|
|
close(f);
|
2019-08-22 15:48:47 +02:00
|
|
|
|
|
|
|
%% Convert the Data
|
|
|
|
data = SimulinkRealTime.utils.getFileScopeData('data/data_001.dat').data;
|
|
|
|
|
|
|
|
t = data(:, end);
|
2019-09-10 16:05:05 +02:00
|
|
|
ux = data(:, 1);
|
|
|
|
uy = data(:, 2);
|
|
|
|
yx = data(:, 3);
|
|
|
|
yy = data(:, 4);
|
2019-08-22 15:48:47 +02:00
|
|
|
|
2019-09-10 16:05:05 +02:00
|
|
|
save('mat/data_001.mat', 't', 'ux', 'uy', 'yx', 'yy');
|
2019-08-22 15:48:47 +02:00
|
|
|
|
|
|
|
%% Plot the data
|
|
|
|
figure;
|
|
|
|
hold on;
|
2019-09-10 16:05:05 +02:00
|
|
|
plot(t, ux);
|
|
|
|
plot(t, uy);
|
2019-08-22 15:48:47 +02:00
|
|
|
hold off
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|
|
|
|
|
2019-09-10 16:05:05 +02:00
|
|
|
figure;
|
|
|
|
hold on;
|
|
|
|
plot(t, yx);
|
|
|
|
plot(t, yy);
|
|
|
|
hold off
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|