How can I plot two functions in the same diagramm?
Show older comments
I will plot both function in the same diagramm? What is wrong?
clear all, close all, clc
v=1000*0.005*0.995; %Varianz
sigma = sqrt(v); %Standardabweichung
mu = 1000*0.005; %Erwartungswert
dt = 0.1; %Schrittweite
t = 0:dt:10;
Phi(1)= 0; %Startwert
for n=1:length(t),
%Dichtefunktion
phi(n)=1/(sqrt(2+pi)*sigma)*exp(-(t(n)-mu)^2/(2*sigma^2));
%Rechteckintegration
Phi(n+1) = Phi(n) + phi(n)*dt;
end
%Darstellung
p=1-Phi(end),
figure(1),
plot(t,phi),grid on,
title('Glockenkurve der gaußschen Normalverteilung'),
xlabel('Samenkörner');
ylabel('Dichtefunktion');
Accepted Answer
More Answers (0)
Categories
Find more on Signal Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!