 Email discussion lists for the UK Education and Research communities  ## SPM@JISCMAIL.AC.UK

#### View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Proportional Font  LISTSERV Archives  SPM Home  SPM 1999

#### Options  Subscribe or Unsubscribe   Log In   Get Password Subject: Re: slice timing.. same problem as http://www.mailbase.ac.uk/lists/spm/1999-07/0142.html

From:  Date: Wed, 22 Sep 1999 12:53:55 +0100 (BST)

Content-Type: TEXT/plain

Parts/Attachments:  TEXT/plain (68 lines)
 ```| I have exactly the same problem aswas described in | http://www.mailbase.ac.uk/lists/spm/1999-07/0142.html | | I followed what was suggested by specifying a user specified | slice order and a proper ref. slice in space, but SPM | crashes, | giving the error msg | > "In an assignment A(matrix,matrix) = B, the number of rows in B and the | > number of elements in the A row index matrix must be the same." | > "On line 186 --> stack(nimago+1:size(stack,1),g) = | > linspace(stack(nimgo,g), stack(1,g), nimg-nimgo);" | > "Error while evaluating uicontrol callback"" I know there is a bug in the linspace.m function of Matlab 5.2.0.3084, which may be the source of the problem. The problematic code (by typing "type linspace" within Matlab) looks like: ------------------------------------------------------------------ function y = linspace(d1, d2, n) %LINSPACE Linearly spaced vector. % LINSPACE(x1, x2) generates a row vector of 100 linearly % equally spaced points between x1 and x2. % % LINSPACE(x1, x2, N) generates N points between x1 and x2. % % See also LOGSPACE, :. % Copyright (c) 1984-98 by The MathWorks, Inc. % \$Revision: 5.6 \$ \$Date: 1997/11/21 23:29:09 \$ if nargin == 2     n = 100; end if n~=1   y = d1:(d2-d1)/(n-1):d2; else   y = d2; end ------------------------------------------------------------------ To fix the problem, you could try replacing the matlab/toolbox/matlab/elmat/linspace.m function with: ------------------------------------------------------------------ function y = linspace(d1, d2, n) %LINSPACE Linearly spaced vector. % LINSPACE(x1, x2) generates a row vector of 100 linearly % equally spaced points between x1 and x2. % % LINSPACE(x1, x2, N) generates N points between x1 and x2. % % See also LOGSPACE, :. % Copyright (c) 1984-98 by The MathWorks, Inc. % \$Revision: 5.8 \$ \$Date: 1998/05/11 15:58:47 \$ if nargin == 2     n = 100; end y = [d1+(0:n-2)*(d2-d1)/(n-1) d2]; ------------------------------------------------------------------ Good luck, -John %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ```