Cant get my code to work

1 vue (au cours des 30 derniers jours)
Jack Ellis
Jack Ellis le 28 Oct 2019
Commenté : Jack Ellis le 28 Oct 2019
Hi, ive written the following function
function Guass_t=Gaussian_t(x)
n = length(x);
mean = sum(x)/n;
std = sqrt(sum((x-mean).^2/n));
A=sqrt(2*pi*((std).^2));
B=1/A;
C=(x-mean).^2;
D=2*std*std;
Gauss_t= B*exp(-C/D)
end
It doesnt seem to work. It keeps saying Guass_t is undefined. Please can someone explain where I have gone wrong.

Réponse acceptée

Stephen23
Stephen23 le 28 Oct 2019
Modifié(e) : Stephen23 le 28 Oct 2019
Note the spelling difference:
Guass_t % function output arugment
Gauss_t % variable defined in the function
  1 commentaire
Jack Ellis
Jack Ellis le 28 Oct 2019
Hi, thankyou so much

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by