Azzera filtri
Azzera filtri

ls command on a Mac doesn't work

5 visualizzazioni (ultimi 30 giorni)
Deja C
Deja C il 8 Dic 2021
Modificato: Shubham il 30 Apr 2024
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.

Risposte (1)

Shubham
Shubham il 30 Apr 2024
Modificato: Shubham il 30 Apr 2024
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!

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by