Musterlösung Schwingung
Schwingung.m
%% Mit diesem Skript wird eine Schwingung ermittelt
% Date : 06.11.2013
% Author : Katharina Albrecht, Frithjof Meyer
% Institut : DiK
t = 0 : 0.1 : 30; % Zeitintervall t in [s]
y = A *sin(omega*t) % Schwingung wird berechnet
plot(t,y) %rein optional
eine globale definition von A und omega ist nicht nötig, da hier ein Skript geschrieben wird. Nach Definition der Variablen im Command Window kann dann das Skript einfach aufgerufen werden.
Command Window
>> global omega
>> omega = 0.5;
>> global A
>> A= 10;
>> Schwingung;