List all matlab files in python
조회 수: 11 (최근 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!