fullfile returns error. how to properly use it to perform this code below
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Adam
el 14 de Nov. de 2017
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.
Respuesta aceptada
OCDER
el 14 de Nov. de 2017
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!