How do I create a matlab function called enter_data.m

How do I create a matlab function called enter_data.m the function will take in a single input which is the number of experimental trials

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 10 月 10 日
編集済み: Walter Roberson 2017 年 10 月 10 日

0 投票

edit enter_data.m
and insert the code, which might look something like
function entered_data = enter_data( number_of_trials )
entered_data = [];
for TN = 1 : number_of_trials
data_for_trial = input( sprintf('Enter data for trial #%d', TN) );
entered_data(TN, 1:length(data_for_trial)) = data_for_trial;
end

カテゴリ

ヘルプ センター および File ExchangeDesktop についてさらに検索

タグ

質問済み:

2017 年 10 月 10 日

編集済み:

2017 年 10 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by