comparison spzeros.m @ 592:4422c4476650 feature/utux2D

Merge with feature/grids
author Martin Almquist <martin.almquist@it.uu.se>
date Mon, 11 Sep 2017 14:17:15 +0200
parents 13d2f20c0c0d
children
comparison
equal deleted inserted replaced
591:39554f2de783 592:4422c4476650
1 function S = spzeros(varargin)
2 switch length(varargin)
3 case 2
4 S = sparse(varargin{1}, varargin{2});
5 case 1
6 v = varargin{1};
7 switch length(v)
8 case 1
9 S = sparse(v,v);
10 case 2
11 S = sparse(v(1), v(2));
12 otherwise
13 error('Input must be either one integer, two integers or a vector with two integers');
14 end
15 otherwise
16 error('Too many input arguments.');
17 end
18 end