i have a homework that i have been stuck on, can anyone help ?

1 visualización (últimos 30 días)
ali
ali el 28 de Jul. de 2022
Respondida: 2NOR_Kh el 2 de Ag. de 2022
how to gentate a plot of this function from z = -5 to 5 , and to label the ordinate as ferquency and the ab-
scissa as z ?
  3 comentarios
David Hill
David Hill el 28 de Jul. de 2022
Show us your code and ask a specific question.
ali
ali el 28 de Jul. de 2022
i dont know how to write it to be honest the doctor has not explaind everything and decided to give us a homework on it , i have tried to understand how to but its a dead end

Iniciar sesión para comentar.

Respuestas (2)

Mathias Smeets
Mathias Smeets el 28 de Jul. de 2022
Editada: Mathias Smeets el 28 de Jul. de 2022
I would recommend some matlab tutorial, since this is very basic. However:
% make z from -5 to 5 with steps of 0.01
z = -5:0.01:5
% create the function
f = (1 / (sqrt(2*pi))) * exp(- z.^2 / 2)
% plot the function
plot(z,f)
% label your axes
xlabel('z')
ylabel('frequency')

2NOR_Kh
2NOR_Kh el 2 de Ag. de 2022
you can change parameters to see how this will change. Also, in gaussian distribution, there is another important parameter named sigma. you can add it to the code and see how the curve will change.
good luck with that.
srate=0.01;
z=-5:srate:5;
Exp_comp = -z.^2/2;
GL = exp(-z.^2)/2;
figure,plot(z,GL),xlabel(' frequency');ylabel(' z');

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by