how to Write a function that takes a file name as its only argument (input value) in Matlab ?

3 ビュー (過去 30 日間)
Dimuthu
Dimuthu 2022 年 11 月 5 日
編集済み: Maik 2022 年 11 月 5 日
using physionet.orag to download 128 sapling frequency ECG files.
  1. write a function that takes file name as only argument (input value)?

回答 (1 件)

Maik
Maik 2022 年 11 月 5 日
編集済み: Maik 2022 年 11 月 5 日
You can save the file as a function with no inputs and pass its output as inputs to the second function.
1st Function = sumOfNum
2nd Function = sumPrint
sumOfNum is passed as input to sumPrint. You can save the sumOfNum in separate .m file with the function name.
Basically here we will be passing sumOfNum.m as input to sumPrint
sumPrint(sumOfNum());
100 50
function sumPrint(firstFuncOut)
firstFuncOut = firstFuncOut/2;
disp(firstFuncOut);
end
function firstFuncOut = sumOfNum()
firstFuncOut = 100;
disp(firstFuncOut);
end

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by