Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Ralph
Ralph le 3 Fév 2014
Modifié(e) : Image Analyst le 4 Fév 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?

Réponses (1)

Image Analyst
Image Analyst le 3 Fév 2014
Try the function call
storedVariables = load('SSTA.mat')
  2 commentaires
Ralph
Ralph le 4 Fév 2014
It does not solve the issue.
Image Analyst
Image Analyst le 4 Fév 2014
Modifié(e) : Image Analyst le 4 Fév 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)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Search Path dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by