Error using cd command

조회 수: 8 (최근 30일)
shahad moh
shahad moh 2016년 11월 17일
댓글: Walter Roberson 2016년 11월 17일
I have a problem in cd command
for i=1:length(Arr)
cd(category{:,i});
..... etc
category is vector that contain directories names. when I try to run it, the following error comes: "Argument must contain a character vector"
What is the problem? How can I fix it?
I'm using matlab 2016 for mac thank you.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 11월 17일
Your use of
cd(category{:,i});
suggests that you are extracting a row of elements rather than a single element. A single element would be expected to look like
cd(category{1,i});
or
cd(category{i});
  댓글 수: 2
shahad moh
shahad moh 2016년 11월 17일
I tried them, but still genrates same problem
Walter Roberson
Walter Roberson 2016년 11월 17일
What is class(category{1,1}) and size(category[1,1}) ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by