Borrar filtros
Borrar filtros

??? Undefined function or method 'SSTA' for input arguments of type 'char'

2 visualizaciones (últimos 30 días)
Ralph
Ralph el 3 de Feb. de 2014
Editada: Image Analyst el 4 de Feb. de 2014
I run a script file with command 'load SSTA.mat'. The file 'SSTA.mat' is in the same folder as the script, so there should be no path issues. Why do I get the error '??? Undefined function or method 'SSTA' for input arguments of type 'char'' and how do I fix it?

Respuestas (1)

Image Analyst
Image Analyst el 3 de Feb. de 2014
Try the function call
storedVariables = load('SSTA.mat')
  2 comentarios
Ralph
Ralph el 4 de Feb. de 2014
It does not solve the issue.
Image Analyst
Image Analyst el 4 de Feb. de 2014
Editada: Image Analyst el 4 de Feb. de 2014
Show your code, and the COMPLETE error message - all the red text, not just part of it.
Try this more robust code:
% Change the current folder to the folder of this m-file.
% (The line of code below is from Brett Shoelson of The Mathworks.)
cd(fileparts(which(mfilename)));
% Read in a standard MATLAB mat file.
% First get the full file name.
folder = pwd
baseFileName = 'SSTA.mat';
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
% Check if file exists.
if ~exist(fullFileName, 'file')
% File doesn't exist -- didn't find it there. Check the search path for it.
fullFileName = baseFileName; % No path this time.
if ~exist(fullFileName, 'file')
% Still didn't find it. Alert user.
errorMessage = sprintf('Error: %s does not exist in the search path folders.', fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
storedVariables = load(fullFileName)

Iniciar sesión para comentar.

Categorías

Más información sobre Search Path en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by