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

2 次查看(过去 30 天)
rootpath = {};
D = dir(rootpath);
  1 个评论
Stephen23
Stephen23 2016-2-25
编辑:Stephen23 2016-2-25
Answer: Don't use a cell array for the input.
Read the dir documentation. It clearly states that the input must be a string.

请先登录,再进行评论。

采纳的回答

Guillaume
Guillaume 2016-2-25
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by