1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "" "lang")((modname |29.3|) (read-case-sensitive #t) (teachpacks ((lib "" "teachpack" "htdp") (lib "" "teachpack" "htdp") (lib "" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #t #t none #f ((lib "" "teachpack" "htdp") (lib "" "teachpack" "htdp") (lib "" "teachpack" "htdp")))))
4 A matrix is a (vectorof (vectorof numbers)). Specifically, an rxc matrix has a vector-length of r, and each element has a vector-length of c.
6 (define (build-matrix rows cols f)
7 (build-vector rows (lambda (r)
8 (build-vector cols (lambda (c) (f (+ r 1) (+ c 1)))))))
10 (define (transpose a-matrix)