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 件のコメント

Adam
Adam 2017 年 11 月 14 日
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.
soro
soro 2017 年 11 月 14 日
extension of file like png,jpg

サインインしてコメントする。

 採用された回答

OCDER
OCDER 2017 年 11 月 14 日

0 投票

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

1 件のコメント

soro
soro 2017 年 11 月 15 日
you were right it gave me .data/basketball/img 1

サインインしてコメントする。

その他の回答 (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!