Info

此问题已关闭。 请重新打开它进行编辑或回答。

Error - No arguments -- dir"\"

1 次查看(过去 30 天)
Vignesh Mahalingam
Vignesh Mahalingam 2019-11-13
关闭: MATLAB Answer Bot 2021-8-20
if ~exist('scale', 'var')
scale = 1;
end
if ~exist('models_dir','var')
rectify = false;
else
rectify = true;
if models_dir(end) ~= '/'
models_dir = [models_dir '/'];
end
end
if directory(end) ~= '/' """"___ I get an error in this Line___""
directory = [directory '/'];
end
if exist([directory 'stereo'],'file') ...
|| exist([directory 'mono_left'], 'file') ...
|| exist([directory 'mono_right'], 'file') ...
|| exist([directory 'mono_rear'], 'file')
% Top level log directory, play all
directories = {};
stereo_dirs = {};
models = {};
stereo_models = {};
timestamps = {};
-------The following error appears -------
Not enough input arguments.
Error in PlayImages (line 44)
if directory(end) ~= '/'
---------------
  1 个评论
Stephen23
Stephen23 2019-11-13
You try to access directory before it is defined.
To make the code intent clear test for exist's specific output value, e.g.:
1~=exist(...,'var')

回答(1 个)

Walter Roberson
Walter Roberson 2019-11-13
Somewhere on your MATLAB path you have a function named directory, and you do not have a variable by that name that is visible to the program. Or possibly you have a variable named directory that is a function handle.
which directory

产品

Community Treasure Hunt

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

Start Hunting!

Translated by