clear all;
close all;
%% Import data from spreadsheet

%Import the data
[~, ~, raw0_0] = xlsread('Z:\Dokumente\Daten_.xls','Hauptmessung1','B3:B5633');
[~, ~, raw0_1] = xlsread('Z:\Dokumente\Daten_.xls','Hauptmessung1','C3:C5633');
raw = [raw0_0,raw0_1];

%Replace non-numeric cells with 0.0
R = cellfun(@(x) ~isnumeric(x) || isnan(x),raw); % Find non-numeric cells
raw(R) = {0.0}; % Replace non-numeric cells

%Create output variable
Geschw = cell2mat(raw);

%Clear temporary variables
clearvars raw raw0_0 raw0_1 R;
%%
u=Geschw(:,2);               % Geschwindigkeit m/s; 
t=Geschw(:,1);               % Zeit 
%% -------------------------------------------------------------------------------
fs = 100;                    % Sample frequency (Hz)
fn = fs/2;                   % Nyquistfrequenz

x=u;                         % Geschwindigkeit
m =length(x);                % Window length
n = pow2(nextpow2(m)-1);     % gewünschte FFT-Länge (n=2^x, sonst wird der DFT-Algorithmus verwendet!)
y=fft(x,n);                  % DFT


% Graphische Darstellung 
figure(1)
plot(t,u)
xlabel('t [s]')
ylabel('u [m/s]')


