summaryrefslogtreecommitdiffstats log msg author committer range
blob: 73895bcfb8e7125d7b0cbe4766c0482bb97eb510 (plain)
 ```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 ``` ``````// Copyright (C) 2019 - Stéphane MOTTELET // // This file is distributed under the same license as the Scilab package. // ============================================================================= // // <-- CLI SHELL MODE --> // // <-- Non-regression test for bug 15781 --> // // <-- Bugzilla URL --> // http://bugzilla.scilab.org/15781 // // <-- Short Description --> // display of complex matrix is ugly. n=4 n = 4. a=testmatrix("magic",4); for f = ["v","e"] format(f) x=complex(cos(a),sin(a)); x(3,3)=%nan; x(4,4)=%inf; x(2,1:2)=1+%i; x(:,1)=0; disp(x) for i=1:n disp(x(i,:)) disp(" ") end for i=1:n disp(x(:,i)) disp(" ") end x=x-x; disp(x) disp(" ") acoth(-2:0.5:2).' end column 1 to 3 0. + 0.i -0.4161468 + 0.9092974i -0.9899925 + 0.14112i 0. + 0.i 1. + i -0.8390715 - 0.5440211i 0. + 0.i 0.7539023 + 0.6569866i Nan + 0.i 0. + 0.i 0.1367372 + 0.9906074i -0.7596879 + 0.6502878i column 4 0.9074468 + 0.420167i -0.1455 + 0.9893582i 0.843854 - 0.5365729i Inf + 0.i column 1 to 3 0. + 0.i -0.4161468 + 0.9092974i -0.9899925 + 0.14112i column 4 0.9074468 + 0.420167i " " 0. + 0.i 1. + i -0.8390715 - 0.5440211i -0.1455 + 0.9893582i " " 0. + 0.i 0.7539023 + 0.6569866i Nan + 0.i 0.843854 - 0.5365729i " " column 1 to 3 0. + 0.i 0.1367372 + 0.9906074i -0.7596879 + 0.6502878i column 4 Inf + 0.i " " 0. 0. 0. 0. " " -0.4161468 + 0.9092974i 1. + i 0.7539023 + 0.6569866i 0.1367372 + 0.9906074i " " -0.9899925 + 0.14112i -0.8390715 - 0.5440211i Nan + 0.i -0.7596879 + 0.6502878i " " 0.9074468 + 0.420167i -0.1455 + 0.9893582i 0.843854 - 0.5365729i Inf + 0.i " " 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i Nan + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i Nan + 0.i " " ans = -0.5493061 + 0.i -0.804719 + 0.i -Inf - 1.5707963i -0.5493061 - 1.5707963i 0. - 1.5707963i 0.5493061 - 1.5707963i Nan + Nani 0.804719 + 3.1415927i 0.5493061 + 3.1415927i column 1 to 2 0.000D+00 + 0.000D+00i -4.161D-01 + 9.093D-01i 0.000D+00 + 0.000D+00i 1.000D+00 + 1.000D+00i 0.000D+00 + 0.000D+00i 7.539D-01 + 6.570D-01i 0.000D+00 + 0.000D+00i 1.367D-01 + 9.906D-01i column 3 to 4 -9.900D-01 + 1.411D-01i 9.074D-01 + 4.202D-01i -8.391D-01 - 5.440D-01i -1.455D-01 + 9.894D-01i Nan + 0.000D+00i 8.439D-01 - 5.366D-01i -7.597D-01 + 6.503D-01i Inf + 0.000D+00i column 1 to 2 0.000D+00 + 0.000D+00i -4.161D-01 + 9.093D-01i column 3 to 4 -9.900D-01 + 1.411D-01i 9.074D-01 + 4.202D-01i " " column 1 to 2 0.000D+00 + 0.000D+00i 1.000D+00 + 1.000D+00i column 3 to 4 -8.391D-01 - 5.440D-01i -1.455D-01 + 9.894D-01i " " column 1 to 3 0.000D+00 + 0.000D+00i 7.539D-01 + 6.570D-01i Nan + 0.000D+00i column 4 8.439D-01 - 5.366D-01i " " column 1 to 2 0.000D+00 + 0.000D+00i 1.367D-01 + 9.906D-01i column 3 to 4 -7.597D-01 + 6.503D-01i Inf + 0.000D+00i " " 0.000D+00 0.000D+00 0.000D+00 0.000D+00 " " -4.161D-01 + 9.093D-01i 1.000D+00 + 1.000D+00i 7.539D-01 + 6.570D-01i 1.367D-01 + 9.906D-01i " " -9.900D-01 + 1.411D-01i -8.391D-01 - 5.440D-01i Nan + 0.000D+00i -7.597D-01 + 6.503D-01i " " 9.074D-01 + 4.202D-01i -1.455D-01 + 9.894D-01i 8.439D-01 - 5.366D-01i Inf + 0.000D+00i " " column 1 to 2 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i column 3 to 4 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i Nan + 0.000D+00i 0.000D+00 + 0.000D+00i 0.000D+00 + 0.000D+00i Nan + 0.000D+00i " " ans = -5.493D-01 + 0.000D+00i -8.047D-01 + 0.000D+00i -Inf - 1.571D+00i -5.493D-01 - 1.571D+00i 0.000D+00 - 1.571D+00i 5.493D-01 - 1.571D+00i Nan + Nani 8.047D-01 + 3.142D+00i 5.493D-01 + 3.142D+00i format("v") a= [0,0,%i*0.6795197,0.7161007+%i*0.3997826,0 0,%i*0.977002,0,0,0 0,0.2629713,0,0,0.4505416 0,%i*0.8173032,0.529842,0,%i*0.8558751 0,0,0,0.7481516,%i*0.2598704 0,0.3402197+%i*0.3631865,0,0,0 0,%i*0.8686947,%i*0.0844358,0.9883794,0 0,0,0,0,0 0,0.6540791,0.6892145+%i*0.3462334,0,0 0,0,0,0,0.7204935] a = column 1 to 3 0. + 0.i 0. + 0.i 0. + 0.6795197i 0. + 0.i 0. + 0.977002i 0. + 0.i 0. + 0.i 0.2629713 + 0.i 0. + 0.i 0. + 0.i 0. + 0.8173032i 0.529842 + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0.3402197 + 0.3631865i 0. + 0.i 0. + 0.i 0. + 0.8686947i 0. + 0.0844358i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0.6540791 + 0.i 0.6892145 + 0.3462334i 0. + 0.i 0. + 0.i 0. + 0.i column 4 to 5 0.7161007 + 0.3997826i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0.4505416 + 0.i 0. + 0.i 0. + 0.8558751i 0.7481516 + 0.i 0. + 0.2598704i 0. + 0.i 0. + 0.i 0.9883794 + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0. + 0.i 0.7204935 + 0.i ``````