1//<-- CLI SHELL MODE -->
2// =============================================================================
3// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4// Copyright (C) 2009 - INRIA - Serge Steer
5//
6//  This file is distributed under the same license as the Scilab package.
7// =============================================================================
8
9// <-- Non-regression test for bug 4266 -->
10//
11// <-- Bugzilla URL -->
12// http://bugzilla.scilab.org/show_bug.cgi?id=4266
13//
14// <-- Short Description -->
15// ones, rand, zeros functions do not remove highest dimensions equal to 1.
16a=ones(2,2,1);
17if or(size(a)<>[2 2]) then pause,end
18a=ones(2,2,1,1);
19if or(size(a)<>[2 2]) then pause,end
20if or(a<>ones(2,2)) then pause,end
21a=ones(2,2,2);
22if or(size(a)<>[2 2 2]) then pause,end
23
24a=zeros(2,2,1);
25if or(size(a)<>[2 2]) then pause,end
26a=zeros(2,2,1,1);
27if or(size(a)<>[2 2]) then pause,end
28if or(a<>zeros(2,2)) then pause,end
29a=zeros(2,2,2);
30if or(size(a)<>[2 2 2]) then pause,end
31
32a=rand(2,2,1);
33if or(size(a)<>[2 2]) then pause,end
34a=rand(2,2,1,1);
35if or(size(a)<>[2 2]) then pause,end
36if or(a<>a(:,:)) then pause,end
37a=rand(2,2,2);
38if or(size(a)<>[2 2 2]) then pause,end
39
40
41a=rand(2,2,1,'normal');
42if or(size(a)<>[2 2]) then pause,end
43a=rand(2,2,1,1,'normal');
44if or(size(a)<>[2 2]) then pause,end
45if or(a<>a(:,:)) then pause,end
46a=rand(2,2,2,'normal');
47if or(size(a)<>[2 2 2]) then pause,end
48
49
50