File: testmat.m

package info (click to toggle)
combblas 2.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 190,488 kB
  • sloc: cpp: 55,918; ansic: 25,134; sh: 3,691; makefile: 548; csh: 66; python: 49; perl: 21
file content (18 lines) | stat: -rw-r--r-- 422 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function A = testmat(nr,nc)
% TESTMAT : create test matrix for indexing functions
%
% A = testmat(nr,nc) returns a full nr-by-nc matrix whose entries
%                  can be read as i,j coordinates
%
% John R. Gilbert,  4 Sep 2010

if nargin < 1
    nr = 7;
end;
if nargin < 2
    nc = nr;
end;
Rows = (1:nr)'*ones(1,nc);
Cols = ones(nr,1)*(1:nc);
scale = 10^(1+floor(log10(nc)));
A = scale*Rows + Cols;