Prev: Counting of stem cells from an microscopic image.
Next: How to access .m files situated at a directory other than theworking direc
From: Arie Driga on 13 Feb 2010 03:30 Hi! I tried to read and present a picture in matlab. The picture itself was created using adobe illustrator and then I saved it in tif format. When I tried to use 'imread', the following error message appears: >> imread(Calculation_1.tif) ??? Attempt to reference field of non-structure array And when I tried to directly use imshow, the following error message appears: >> imshow(Calculation_1.tif) ??? Attempt to reference field of non-structure array. What has gone wrong here? The picture is quite big, the size is 3617x2329 But, I did tried to cut the picture and re-save it using paint, and still the same error messages appear.
From: Thomas Clark on 13 Feb 2010 05:37 Arie, You need to specify the filename as a string: A = imread('Calculation_1.tif'); % OR filename = 'Calculation_1.tif'; A = imread(filename); Without the quotation marks, matlab thinks that Calculation_1 is the name of a variable, which could contain the filename (as in the second example above) - but of course the variable Calculation_1 doesn't exist. In this case, the error message was complicated by the fact that the .tif was present - it made Matlab think that the filename was stored in a data type called a structure, which uses the . notation to group variables together. Hope this helps Tom C "Arie Driga" <a_driga(a)yahoo.com> wrote in message <hl5nuu$i0k$1(a)fred.mathworks.com>... > Hi! > > I tried to read and present a picture in matlab. The picture itself was created using adobe illustrator and then I saved it in tif format. > > When I tried to use 'imread', the following error message appears: > >> imread(Calculation_1.tif) > ??? Attempt to reference field of non-structure array > > And when I tried to directly use imshow, the following error message appears: > >> imshow(Calculation_1.tif) > ??? Attempt to reference field of non-structure array. > > What has gone wrong here? > The picture is quite big, the size is 3617x2329 > But, I did tried to cut the picture and re-save it using paint, and still the same error messages appear.
From: Arie Driga on 13 Feb 2010 06:10 "Arie Driga" <a_driga(a)yahoo.com> wrote in message <hl5nuu$i0k$1(a)fred.mathworks.com>... > Hi! > > I tried to read and present a picture in matlab. The picture itself was created using adobe illustrator and then I saved it in tif format. > > When I tried to use 'imread', the following error message appears: > >> imread(Calculation_1.tif) > ??? Attempt to reference field of non-structure array > > And when I tried to directly use imshow, the following error message appears: > >> imshow(Calculation_1.tif) > ??? Attempt to reference field of non-structure array. > > What has gone wrong here? > The picture is quite big, the size is 3617x2329 > But, I did tried to cut the picture and re-save it using paint, and still the same error messages appear. Thanks Tom! It appears there is something wrong which I do not know. I did try with what you told me, but it say that the file could not be found. I restarted my matlab, and now it works. But the problem has been solved now!
From: ImageAnalyst on 13 Feb 2010 07:44 The image wasn't in your current folder or your path. In that case you'd need to supply the full path name of the file.
From: Nathan on 15 Feb 2010 16:37
On Feb 13, 3:10 am, "Arie Driga" <a_dr...(a)yahoo.com> wrote: > "Arie Driga" <a_dr...(a)yahoo.com> wrote in message <hl5nuu$i0...(a)fred.mathworks.com>... > > Hi! > > > I tried to read and present a picture in matlab. The picture itself was created using adobe illustrator and then I saved it in tif format. > > > When I tried to use 'imread', the following error message appears: > > >> imread(Calculation_1.tif) > > ??? Attempt to reference field of non-structure array > > > And when I tried to directly use imshow, the following error message appears: > > >> imshow(Calculation_1.tif) > > ??? Attempt to reference field of non-structure array. > > > What has gone wrong here? > > The picture is quite big, the size is 3617x2329 > > But, I did tried to cut the picture and re-save it using paint, and still the same error messages appear. > > Thanks Tom! > > It appears there is something wrong which I do not know. > I did try with what you told me, but it say that the file could not be found. > I restarted my matlab, and now it works. > But the problem has been solved now! For future reference, please don't double post. I answered your question in your first posting: http://www.mathworks.com/matlabcentral/newsreader/view_thread/273631#717341 -Nathan |