Importing a tif picture into Matlab

2 次查看(过去 30 天)
I have a file in the following address:
S:\Nanotip\Results\FEM-Images\Data\Pictures\190321\tifData
and this file contains many pictures , each one has a name similar to this :
p190321aa.tif
I need to import such pictures into matlab. I am using the following code:
clear all
close all
directoryAll='S:\Nanotip\Results\FEM-Images\Data\Pictures\190321\tifData\';
File=strcat(directoryAll,'p190321aa.tif');
imread('File')
imagesc('File')
But once I run the code I got the following error:
Error using imread (line 350)
File "File" does not exist.
Error in image_show (line 10)
imread('File');
Any suggestions? Thank you in advance.

采纳的回答

Star Strider
Star Strider 2019-6-9
Try this instead:
Itif = imread(File)
imagesc(Itif)
Note that the single quotes around 'File' make it a string itself, not the variable containing your path and file name. If you use File without the quotes, you are passing the directory and file name string to imread.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Search Path 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by