ls command on a Mac doesn't work

5 次查看(过去 30 天)
Deja C
Deja C 2021-12-8
编辑: Shubham 2024-4-30
ls works if I use it in the command window in MATLAB R2021b and in the Mac terminal, but it doesn't work in a live script.
When running a code in the editor window in MATLAB, I always get an error stating that the file is invalid or not found in the directory. I need my code to read a list of files in the directory to go through a loop.
I apologize in advance. I'm not the most fluent in computer science.

回答(1 个)

Shubham
Shubham 2024-4-30
编辑:Shubham 2024-4-30
Hey Deja,
In MATLAB, the ls command works similarly to how it does in UNIX-based systems (like Mac's terminal) for listing directory contents. However, when you're working in a MATLAB Live Script or the MATLAB editor and you encounter issues with ls not functioning as expected, it's often due to differences in how the environment handles current directories or path issues.
You may find the below resources useful:
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by