File: test_assign16.m

package info (click to toggle)
freemat 4.2%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 141,800 kB
  • ctags: 14,082
  • sloc: ansic: 126,788; cpp: 62,046; python: 2,080; perl: 1,255; sh: 1,146; yacc: 1,019; lex: 239; makefile: 100
file content (16 lines) | stat: -rw-r--r-- 405 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
% Test for bug 1808557 - incorrect subset assignment with complex arrays
function test_val = test_assign16
   x = rand(4,2)+i*rand(4,2);
   y = rand(2,2)+i*rand(2,2);
   x(2:2:4,:)=y;
   z = x;
   for i=1:2;
     for j=1:2;
       z(2+(i-1)*2,j) = y(i,j);
     end
   end
  q = x;
  q(:,1) = y(:);
  p = [x,x];
  p(1,:) = y(:);
  test_val = all(vec(z==x)) && all(q(:,1) == y(:)) && all(p(1,:).' == y(:));