필터 지우기
필터 지우기

How to write a code for a distribution?

조회 수: 5 (최근 30일)
Maria Amr
Maria Amr 2021년 2월 4일
댓글: Maria Amr 2021년 2월 5일
Hello every one,
I would really appreciate if anyone can help me about a code as I am really new in MATLAB. I just want to write a code based on the equation that is a distribution. Thank you!
%This is the equation:
% g(r)=β/(2αγ(1/β)) e^(-((|r-μ|)/α)^β ) [1+erf(k((r-μ)/α))]
% the code is below but there is an error: Error using exp , Not enough input arguments
mu=mean(r);
alfa=input('alfa is considered as:')
beta=input('beta is considered as:')
K=input('k is considered as:')
g(r)=(beta/2.*alfa.*gamma(1/beta)).*exp-(abs (r-mu)./alfa).^beta.*[1-erf(K.*(r-mu./alfa))];

채택된 답변

David Hill
David Hill 2021년 2월 5일
mu=mean(r);
alfa=input('alfa is considered as:')
beta=input('beta is considered as:')
K=input('k is considered as:')
g(r)=beta/(2*alfa*gamma(1/beta)).*exp(-(abs(r-mu)/alfa).^beta).*(1+erf(K*(r-mu)/alfa));
  댓글 수: 1
Maria Amr
Maria Amr 2021년 2월 5일
David Hill Thank you so much1
I truly appreciated if you help me how to fit a curve on it? I I could n't do this with 'makedist', 'fitdist' or distributionfitter'.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by