Passing a string as input in pyrunfile() function

2 ビュー (過去 30 日間)
Glauco
Glauco 2023 年 4 月 26 日
回答済み: Les Beckham 2023 年 4 月 26 日
The function change_delimeter.py takes as input the name of a csv file.
Now, I want to create a matlab function, delimitatore(name_file.csv), which passes the name of the csv file to change_delimeter.py
function delimitatore(name_file)
pyrunfile("change_delimeter.py 'name_file'");
end
If instead of the variable name_file I pass the actual name of the file ('name_file.csv') it works perfectly.

回答 (1 件)

Les Beckham
Les Beckham 2023 年 4 月 26 日
Perhaps this will do what you want
function delimitatore(name_file)
pyrunfile(sprintf("change_delimeter.py %s", name_file));
end

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by