필터 지우기
필터 지우기

Importing a tif picture into Matlab

조회 수: 1 (최근 30일)
Mohammed Qahosh
Mohammed Qahosh 2019년 6월 9일
댓글: Star Strider 2019년 6월 9일
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.
  댓글 수: 2
Mohammed Qahosh
Mohammed Qahosh 2019년 6월 9일
Star Strider Thank you very much for your help. It works :)))
Star Strider
Star Strider 2019년 6월 9일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (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