fullfile returns error. how to properly use it to perform this code below

i am trying to simulate the MEEM tracking algorith but when i run i got the following error that is difficult for me to solve
>> demo
Error using horzcat
The following error occurred converting from logical to char:
Conversion to char from logical is not possible.
Error in MEEMTrack (line 29)
D = dir(fullfile(input,['*.', ext]));
how can i solve it?

댓글 수: 2

You haven't told us what ext is.
You can debug and easily look what this is yourself and whether you can concatenate it with '*.' or not.
extension of file like png,jpg

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

 채택된 답변

OCDER
OCDER 2017년 11월 14일
Seems like ext is a logical value with the value of 1 or 0. The following will give you the same error message:
['a' 1>0] %Error: Conversion to char from logical is not possible.
Probably not an issue with your variable input, since a different error would result like this:
fullfile(1>0, ['*.jpg']) %Error: All inputs must be character vectors or cell arrays of character vectors.
Use the debugger tool or print out the variables before the error:
disp(input)
disp(ext)
disp(fullfile(input,['*.', ext]))
Also, DO NOT label your variable as " input ", as this is a function in Matlab for asking users for inputs. See doc on input

추가 답변 (0개)

카테고리

질문:

2017년 11월 14일

댓글:

2017년 11월 15일

Community Treasure Hunt

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

Start Hunting!