how to check extension of an image file

  • Follow


i am creating a function file in matlab,that takes an image file as input argument.now problem is to open a .dat file i have to use load() and to open a .tif file have to use imread() file.now I want to check the input file extension in my function so that depends on that i can use load() or imread().please reply as soon as possible.its very urgent. 
0
Reply bubai 4/8/2010 12:50:23 PM

bubai marik wrote:
> i am creating a function file in matlab,that takes an image file as 
> input argument.now problem is to open a .dat file i have to use load() 
> and to open a .tif file have to use imread() file.now I want to check 
> the input file extension in my function so that depends on that i can 
> use load() or imread().please reply as soon as possible.its very urgent.

fileparts() and do string comparison on the extension you extract.


(I don't actually use this approach myself, but then my 
suffix-extraction code for my current project is designed around the 
fact that we can end up with multiple suffixes, such as .txt.mat .)
0
Reply Walter 4/8/2010 1:36:38 PM


1 Replies
397 Views

(page loaded in 0.035 seconds)

Similiar Articles:













7/20/2012 4:53:59 PM


Reply: