Skip to content

Commit 5086a0b

Browse files
committed
fix broken 1D cases
1 parent a5ebbcb commit 5086a0b

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

functions/fidimat.m

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,19 @@
9090
case 'xx'
9191

9292
XX = spdiags([ones(l,1),-2*ones(l,1),ones(l,1)],-1:1,speye(l));
93-
XX(1,2) = (bctype-1)*2; XX(l,l-1) = (bctype-1)*2;
94-
% if bctype == 0
95-
% XX([1 end],:) = 0;
96-
% end
93+
9794
outM = XX;
9895

9996
case 'xxxx'
10097
XX = spdiags([ones(l,1),-2*ones(l,1),ones(l,1)],-1:1,speye(l));
101-
XX(1,2) = (bctype-1)*2; XX(l,l-1) = (bctype-1)*2;
102-
outM = XX;
103-
outM = XX^2;
98+
XXXX = XX^2;
99+
100+
if (bctype==2)
101+
XXXX(1,1) = 7;
102+
XXXX(end,end) = 7;
103+
end
104+
105+
outM = XXXX;
104106

105107
case 'I'
106108
I = speye(ss);

0 commit comments

Comments
 (0)