Path: news.mathworks.com!not-for-mail
From: "Jimmy " <testbest1@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: more non-singleton rhs dimensions than non-singleton?
Date: Mon, 8 Mar 2010 01:27:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 73
Message-ID: <hn1jpa$t8q$1@fred.mathworks.com>
References: <hn1feh$18f$1@fred.mathworks.com> <hn1hno$nda$1@fred.mathworks.com> <hn1inh$oes$1@fred.mathworks.com> <hn1it6$5qi$1@fred.mathworks.com>
Reply-To: "Jimmy " <testbest1@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1268011626 29978 172.30.248.38 (8 Mar 2010 01:27:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 8 Mar 2010 01:27:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1991178
Xref: news.mathworks.com comp.soft-sys.matlab:614738

> Yeh, I tried it without brackets but still same error. May be I need to change something else in the code as well?

      Thanks

"Sadik " <sadik.hava@gmail.com> wrote in message <hn1it6$5qi$1@fred.mathworks.com>...
> Oh, I put the square brackets for explanation only, as in:
> 
> ... apple [which is a delicious fruit] ...
> 
> Sorry for the confusion.
> 
> Best.
> 
> 
> 
> "Jimmy " <testbest1@yahoo.com> wrote in message <hn1inh$oes$1@fred.mathworks.com>...
> > "Sadik " <sadik.hava@gmail.com> wrote in message <hn1hno$nda$1@fred.mathworks.com>...
> > > Please check the dimensions of I by typing
> > > 
> > > size(I) %without a semicolon or any other input, just size(I)
> > > 
> > > If it is an rgb image that you are reading, it will have 3 dimensions. I think this is why you are getting that error. If you are working with such images, it is a good idea to have a 4D variable [sequence(:,:,:,p)] rather than a 3D one.
> > > 
> > > Best.
> > > 
> > > "Jimmy " <testbest1@yahoo.com> wrote in message <hn1feh$18f$1@fred.mathworks.com>...
> > > >      Hi all,
> > > > 
> > > > I am trying to compile a video from a sequence of images but I am getting the following error: Assignment has more non-singleton rhs dimensions than non-singleton
> > > > subscripts. The code is: 
> > > > 
> > > > fileFolder = fullfile('C:\Users\Dimitar\Documents\MATLAB\Plot');
> > > > path=fullfile(fileFolder,'data*.tif');
> > > > dirOutput = dir(path);
> > > > fileNames ={dirOutput.name};
> > > > numFrames = numel(fileNames);
> > > > I = imread(fullfile(fileFolder,fileNames{+1}));
> > > > rmax=size(I,1);
> > > > cmax=size(I,2);
> > > > 
> > > > sequence = zeros([size(I,1) size(I,2) numFrames], class(I));
> > > > 
> > > > % load in array
> > > > 
> > > > for p = 1:numFrames
> > > >   sequence(:,:,p) = imread(fullfile(fileFolder,fileNames{p}));
> > > > end
> > > > 
> > > > mov = avifile('test.avi','Compression','None','fps',8);
> > > > 
> > > > for j=1:size(sequence,3)
> > > >     imshow(sequence(:,:,j));
> > > >     f=getframe;
> > > >     mov = addframe(mov, f);
> > > > end
> > > > 
> > > > mov = close(mov);
> > > > close all;
> > > > 
> > > > The error is in line:  sequence(:,:,p) = imread(fullfile(fileFolder,fileNames{p}));
> > > > 
> > > >      Does anyone have any idea?
> > > > 
> > > >       Thank you 
> > > >        Jimmy 
> > 
> > >> Hi Sadik,
> > thank you for your reply, I checked the dimenssions and I have 3 dimenssions indeed.
> > I changed it to [sequence(:,:,:,p)] but I have another error saying:   
> >       Subscripted assignment dimension mismatch  
> > 
> >        Thanks 
> >        Jimmy