Skip to content
Prev 303572 / 398503 Next

specific matrix element tranformation

Hello,

I've made a mistake, it's in the last if/else/if/else. Complete 
statement below.

Em 17-08-2012 06:23, Rui Barradas escreveu:
Correction:

     if(a[1,2] == 0){
         warning("a[1, 2] is zero, using zero for division result b[3,3].")
         b[3,3] <- 0
     }else if(a[1,1] < 0){
         warning("a[1, 1] is negative, using zero for its square root 
b[3,3].")
         b[3,3] <- 0
     }else{
         b[3,3] <- sqrt(a[1,1])/a[1,2]
     }

I thought it was sqrt(a[1,1]/a[1,2]).
And apparently I've also forgot to sign.

Rui Barradas