Attachment 'myprod.m'

Download

   1 function p = myprod(a)
   2 %MYPROD    Computes the product of all non-zero elements in vector a.
   3 
   4 n = length(a);
   5 p = 1;
   6 for i=1:n
   7     if a(i) > 0
   8       p = p*a(i);    
   9     end
  10 end

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-03-12 14:03:18, 74.6 KB) [[attachment:ML_Praktikum_U01.pdf]]
  • [get | view] (2009-03-12 14:03:18, 72.1 KB) [[attachment:ML_Praktikum_U02.pdf]]
  • [get | view] (2009-03-12 14:03:18, 66.7 KB) [[attachment:ML_Praktikum_U03.pdf]]
  • [get | view] (2009-03-12 14:03:18, 94.0 KB) [[attachment:ML_Praktikum_U04.pdf]]
  • [get | view] (2009-03-12 14:03:18, 65.2 KB) [[attachment:ML_Praktikum_U05.pdf]]
  • [get | view] (2009-03-12 14:03:18, 79.3 KB) [[attachment:ML_Praktikum_U06.pdf]]
  • [get | view] (2009-03-12 14:03:18, 66.6 KB) [[attachment:Praktikum_ML_Info.pdf]]
  • [get | view] (2009-03-12 14:03:18, 4053.5 KB) [[attachment:U01_usps.mat]]
  • [get | view] (2009-03-12 14:03:18, 6.3 KB) [[attachment:U03_2gaussians.dat]]
  • [get | view] (2009-03-12 14:03:18, 15.6 KB) [[attachment:U03_5gaussians.dat]]
  • [get | view] (2009-03-12 14:03:18, 1018.4 KB) [[attachment:U04_datasets.tar.gz]]
  • [get | view] (2009-03-12 14:03:18, 6.4 KB) [[attachment:U05_datasets.zip]]
  • [get | view] (2009-03-12 14:03:18, 108.7 KB) [[attachment:U06_datasets.tar.gz]]
  • [get | view] (2009-03-12 14:03:18, 1.1 KB) [[attachment:U06_test_margs.m]]
  • [get | view] (2009-03-12 14:03:18, 60.1 KB) [[attachment:fishbowl.mat]]
  • [get | view] (2009-03-12 14:03:18, 22.7 KB) [[attachment:flatroll.mat]]
  • [get | view] (2009-03-12 14:03:18, 0.1 KB) [[attachment:func1.m]]
  • [get | view] (2009-03-12 14:03:18, 371.2 KB) [[attachment:guide.pdf]]
  • [get | view] (2009-03-12 14:03:18, 496.0 KB) [[attachment:lle_talk.pdf]]
  • [get | view] (2009-03-12 14:03:18, 275.7 KB) [[attachment:logfile.txt]]
  • [get | view] (2009-03-12 14:03:18, 0.2 KB) [[attachment:myprod.m]]
  • [get | view] (2009-03-12 14:03:18, 27.3 KB) [[attachment:ratbert-debate.gif]]
  • [get | view] (2009-03-12 14:03:18, 7.6 KB) [[attachment:ratbert-debate.mat]]
  • [get | view] (2009-03-12 14:03:18, 45.3 KB) [[attachment:swissroll.mat]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.