転置è¡åã¯é«æ ¡ã®ææ¥ã§ãç¿ãã¾ããããm è¡n åã®è¡å A ã«å¯¾ã㦠A ã® (i, j) è¦ç´ 㨠(j, i) è¦ç´ ãå
¥ãæ¿ãã n è¡ m åã®è¡åãã¤ã¾ã対è§ç·ã§æåãæãè¿ããè¡åã®ãã¨ãã§ãã è¡åè¨ç®ã«éããããã¼ã¿ã® X, Y ãå転ããããæã«ä½¿ããããã¨ãããã¨æãã¾ãããã¢ã«ã´ãªãºã ã¨ãã¦ã¯é常ã«ç°¡åãªãã®ã§ãã #! /usr/bin/gawk -f # transposed_matrix.awk { for (i = 1; i <= NF; i++) { val[i, NR] = $i; } } END { for (i = 1; i <= NF; i++) { for (j = 1; j <= NR; j++) { printf("%s%s", val[i, j], OFS); } print ""; } } ãããããªãã¼ã¿ãç¨æãã¦è©¦ãã¦ã¿ã¦ãã ããã æ°å¤
{{#tags}}- {{label}}
{{/tags}}