필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Why is this Gaussian function has nonconformant arguments error?

조회 수: 1 (최근 30일)
Ba Ba Black Sheep!
Ba Ba Black Sheep! 2018년 9월 1일
댓글: Walter Roberson 2018년 9월 1일
function m=gaussian(med, var, n)
if ( mod(n, 2)==0 )
n=n+1;
end;
med=double(med);
var=double(var);
med = min (max(-(n+1)/2, med), (n+1)/2);
m=zeros(1,n);
k1=(1/(2*pi*var)^0.5);
k2=-0.5.*((med-(1:n)).^2)./var;
m(1,1:n)=k1.*exp(k2);
Output
>> gaussian([101 2 ; 3 4], [4 301 ; 2 1], [2 2])
error: gaussian: operator /: nonconformant arguments (op1 is 1x1, op2 is 2x2)
error: called from
gaussian at line 13 column 5
>>

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by