A Problem with function

1 回表示 (過去 30 日間)
Guilherme Lopes de Campos
Guilherme Lopes de Campos 2019 年 4 月 22 日
回答済み: Star Strider 2019 年 4 月 22 日
Hi Team MATLAB,
I created a code in MATLAB 2018b, but when I run in MATLAB 2012a, showns the follow error:
function [S,m,d2,qui2] = normalidade(F)
[n,p] = size(F);
m = mean(F);
S = cov(F);
for i = 1:n
d2(i)= (F(i,:)-m)*inv(S)*(F(i,:)-m).';
end
d2 = sort(d2);
for j=1:n
qui2(j)=chi2inv((j-0.5)/n,p);
end
plot(d2,qui2,'*k')
xlabel ('d2')
ylabel ('qui2')
grid
end
Error: File: depuracao_1.m Line: 68 Column: 1
Function definitions are not permitted in this context.
Could help me?
Thank you,
Guilherme

採用された回答

Star Strider
Star Strider 2019 年 4 月 22 日
Save it on your MATLAB search path of user files as: normalidade.m.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

製品


リリース

R2012a

Community Treasure Hunt

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

Start Hunting!

Translated by