Can I use another filename instead?
Afficher commentaires plus anciens
If this file is 'image.nii', and it is located at c:\users\matlab,
while using niftiinfo(filename) funtion,
Is it okay to write niftiinfo("c:\users\matlab\image.nii") instead of niftiinfo("image.nii")?
Réponses (2)
Fangjun Jiang
le 30 Jan 2023
Déplacé(e) : Image Analyst
le 30 Jan 2023
1 vote
Yes and it's better.
1 commentaire
Matlab learner
le 1 Fév 2023
Image Analyst
le 30 Jan 2023
Even more robust:
folder = "c:\users\matlab";
if ~isfolder(folder)
errorMessage = sprintf('Error: folder does not exist:\n', folder);
uiwait(errordlg(errorMessage));
return;
end
fullFileName = fullfile(folder, "image.nii");
if ~isfile(fullFileName)
errorMessage = sprintf('Error: file does not exist:\n', fullFileName);
uiwait(errordlg(errorMessage));
return;
end
% If we get to here, the file exists.
niftiinfo(fullFileName)
Catégories
En savoir plus sur MATLAB Parallel Server dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!