Passing a string as input in pyrunfile() function
조회 수: 2 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!