Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!midway!quads.uchicago.edu!keho From: keho@quads.uchicago.edu (david kehoe) Newsgroups: comp.sys.handhelds Subject: Re: Matrix Operations in 48SX? Message-ID: <1991Apr19.213953.25529@midway.uchicago.edu> Date: 19 Apr 91 21:39:53 GMT References: <1991Apr19.023951.11856@midway.uchicago.edu> Sender: news@midway.uchicago.edu (NewsMistress) Organization: University of Chicago Lines: 24 >.20 100 >.30 250 >.50 275 > >I'd like a program that would do .2*100 + .3*250 + .5*275 = 232.5. A friend just clued me into the DOT function. But now to calculate variances of stock portfolios, I have matrixes that look like this: .081 .0137 .1 .081 .0137 .2 .014 .0137 .4 -.054 .0137 .2 -.054 .0137 .1 I need to calculate (.081-.0137)^2*.1 + (.081-.0137)^2*.2 etc. In other words, subtract the 2nd column from the 1st column, square them, multiply by the third column, and then sum the values. Easy to do in a spreadsheet -- can I write a program that will do this to a matrix? -- "Why my thoughts are my own, when they are in, but when they are out they are another's." - Susanna Martin, executed for witchcraft, 1681. Dave Kehoe keho@midway.uchicago.edu (312) 753-0119