Commit 20d28df1 authored by P41842 (Petz Phillip)'s avatar P41842 (Petz Phillip) 💬
Browse files

Merge branch 'master' of https://gitlab.fh-ooe.at/makerspace/mathessentials into Branch_153fed5d

# Conflicts:
#	Files/LaTeX/main.log
#	Files/Matlab/PlotWeather.m
#	Files/Python/scratch.py
parents 32de63c3 ef40ad57
This diff is collapsed.
% Clear and close all
clear all;
close all;
clc;
% Import csv data
M = csvread('../Testdata/SineAndCosine.csv');
addpath('../../Source/matlab2tikz/src/');
% 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');
matlab2tikz('../LaTeX/Figures/MatlabSineAndCosine.tex', 'showInfo', false, 'width', '\figurewidth', 'height', '\figureheight');
%matlab2tikz('../LaTeX/Figures/LatexFigure.tex', 'standalone', true);
<<<<<<< HEAD
clear all;
close all;
clc;
......@@ -48,3 +49,5 @@ ylabel('Hours');
xlabel('Temperature [C^{\circ}]');
grid on;
grid minor;
=======
>>>>>>> ef40ad57abb72cdf614253823181bc671a42bfff
% 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/1000; % 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
figure;
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
import numpy as np
import matplotlib.pyplot as plt
from matplotlib2tikz import save as tikz_save
# to move files
import shutil
<<<<<<< HEAD
def PlotWaves(Filename):
File = 'C:/Users/Phillip/Documents/mathessentials/Files/Testdata/' + Filename
data = np.genfromtxt(File, delimiter=',', skip_header=0, skip_footer=0, names=['Time', 'Sine', 'Cosine'])
......@@ -46,3 +46,5 @@ def PlotTemperature(Filename):
PlotWaves('SineAndCosine.csv')
PlotTemperature('WetterHagenberg.csv')
=======
>>>>>>> ef40ad57abb72cdf614253823181bc671a42bfff
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