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 commentaires

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

Connectez-vous pour commenter.

 Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Coder dans Centre d'aide et File Exchange

Question posée :

le 14 Nov 2017

Commenté :

le 15 Nov 2017

Community Treasure Hunt

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

Start Hunting!