Hi everyone,

I am having a problem with converting all elements of a matrix to their respective inverse values (NOT the inverse of a matrix). For example, I want element a to become 1/a, element b to become 1/b..... In my example below, the matrix is 8x8. I want to convert all 64 (8*8) elements to their respective inverse values (1/....), so that I can have a new matrix. My real matrix is 63x63 (which is too big for command dataex). I really appreciate your help. Thank you so much!


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double p01 int(p02 p04) double(p06 p08) int(p10 p11 p12)
  0 281 269 155 128 287 436 384
284   0 249 252 154 199 427 303
277 228   0 114 240 444 721 570
164 252 114   0 126 330 553 426
130 154 240 126   0 204 424 310
289 199 518 330 204   0 303 101
437 427 722 590 424 301   0 200
386 303 539 426 310 101 202   0
end