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

조회 수: 1 (최근 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