Commit 9102da73 authored by P41842 (Petz Phillip)'s avatar P41842 (Petz Phillip) 💬
Browse files

Added testdata and matlab files

parent 967ac69c
% Clear and Close all
clear all % Clear all existing variables
clc % Clear all command line outputs
close all % Close all existing windows
% Print of variables
disp('Variables have been cleared.');
% 10 iterations
for iteration=1:10
% Ausgabe
disp(['Hello World - Iteration ' num2str(iteration)]);
end
% Clear and close all
clear all;
close all;
clc;
% Import csv data
M = csvread('../Testdata/SineAndCosine.csv');
% Modify imported data
t = M(:,1);
sinSig = M(:,2);
cosSig = M(:,3);
% Delete M variable
clear M;
% Plotting the signal y over time t
plot(t,sinSig); hold on; % Plot multiple lines
plot(t,cosSig); hold off; % Plot new lines
% Set the figure parameters
legend('Sinus','Cosinus'); % Label both datasets with names
grid minor; % Set a fine datagrid
grid on; % Set a coarse datagrid
xlabel('time (s)'); % Label x axis
ylabel('amplitude'); % Label y axis
title('Sine and cosine, calculated with \pi');
\ No newline at end of file
% Clear and Close all
clear all % Clear all existing variables
clc % Clear all command line outputs
close all % Close all existing windows
% Setting all relevant variables
f = 1; % Set frequency to x hertz
Amp = 1; % Set ampitude to 1
ts = 1/10000; % Set number of sample points
T = 1; % Set simulation time to 1 second
t = 0:ts:T-ts; % Create time vector
sinSig = Amp*sin(2*pi*f*t); % Create sine signal
cosSig = Amp*cos(2*pi*f*t); % Create cosine signal
% Plotting the signal y over time t
plot(t,sinSig); hold on; % Plot multiple lines
plot(t,cosSig); hold off; % Plot new lines
% Set the figure parameters
legend('Sinus','Cosinus'); % Label both datasets with names
grid minor; % Set a fine datagrid
grid on; % Set a coarse datagrid
xlabel('time (s)'); % Label x axis
ylabel('amplitude'); % Label y axis
title('Sine and cosine, calculated with \pi');
% Modify signals
sinSig = sinSig';
cosSig = cosSig';
t = t';
% Export csv data
csvwrite('../Testdata/SineAndCosine.csv', [t, sinSig, cosSig])
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment