PageRenderTime 56ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/octave/array_member_runme.m

#
MATLAB | 25 lines | 17 code | 8 blank | 0 comment | 5 complexity | 63101fc35a8e9e520ab5d63757b5456f MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. array_member
  2. f = Foo();
  3. f.data = cvar.global_data;
  4. for i=0:7,
  5. if (get_value(f.data,i) != get_value(cvar.global_data,i))
  6. error("Bad array assignment");
  7. endif
  8. endfor
  9. for i=0:7,
  10. set_value(f.data,i,-i);
  11. endfor
  12. cvar.global_data = f.data;
  13. for i=0:7,
  14. if (get_value(f.data,i) != get_value(cvar.global_data,i))
  15. error("Bad array assignment")
  16. endif
  17. endfor