Azzera filtri
Azzera filtri

How can fix the Error using dir Function is not defined for 'cell' inputs?

5 visualizzazioni (ultimi 30 giorni)
rootpath = {};
D = dir(rootpath);
  1 Commento
Stephen23
Stephen23 il 25 Feb 2016
Modificato: Stephen23 il 25 Feb 2016
Answer: Don't use a cell array for the input.
Read the dir documentation. It clearly states that the input must be a string.

Accedi per commentare.

Risposta accettata

Guillaume
Guillaume il 25 Feb 2016
The fix is simple, don't pass a cell (an empty one at that) to dir.
It's not clear what you're trying to do. rootpath must be a string that points to a valid path on your machine. Maybe,
rootpath = 'C:\';
but only you know what it should really be.

Più risposte (0)

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by