List all matlab files in python
5 ビュー (過去 30 日間)
古いコメントを表示
Hi. I need to convert the following matlab code to python:
DirList = dir(fullfile(Folder, '*.mat'));
Data = cell(1, length(DirList));
Do you have an idea of how to do it in python?
回答 (1 件)
Al Danial
2022 年 10 月 4 日
from glob import glob
Dir = '.'
mat_files = glob(f'{Dir}/*.mat')
to create the Python list mat_files.
参考
カテゴリ
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!