How to store the output of a function?

1 回表示 (過去 30 日間)
BN
BN 2020 年 7 月 31 日
コメント済み: BN 2020 年 7 月 31 日
I used a function from FEX, when it's run the output is showing in the command window but nothing adds to workspace. Is any way exist to store "Probability associated to the Anderson-Darling rank statistic" (p-value) which shows in the command window?
Here is an example:
X = [38.7 1;41.5 1;43.8 1;44.5 1;45.5 1;46.0 1;47.7 1;58.0 1;
39.2 2;39.3 2;39.7 2;41.4 2;41.8 2;42.9 2;43.3 2;45.8 2;
34.0 3;35.0 3;39.0 3;40.0 3;43.0 3;43.0 3;44.0 3;45.0 3;
34.0 4;34.8 4;34.8 4;35.4 4;37.2 4;37.8 4;41.2 4;42.8 4];
AnDarksamtest(X)
Thanks
  1 件のコメント
Adam Danz
Adam Danz 2020 年 7 月 31 日
I would run the file in debug mode and step through it until you find the section that produces this text. Somehwere in that section is a variable that contains p-value. If it's not already included in the outputs, you could add it.

サインインしてコメントする。

採用された回答

Arthur Roué
Arthur Roué 2020 年 7 月 31 日
編集済み: Arthur Roué 2020 年 7 月 31 日
You can modify the function to output Pn
function [AnDarksamtest, Pn] = AnDarksamtest(X,alpha)
The function itself is well-documented !
...
fprintf('Standardized Anderson-Darling rank statistic: %3.7f\n', ADKsn);
fprintf('Probability associated to the Anderson-Darling rank statistic = %3.7f\n', Pn);
disp(' ')
fprintf('With a given significance = %3.3f\n', alpha);
...
  1 件のコメント
BN
BN 2020 年 7 月 31 日
Thank you all.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProbability Distributions についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by