-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "076c8b3e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#matrix tests for rastering\n", | ||
"#test matricies\n", | ||
"test = zeros(Float64, 3, 3) #3x3 matrix of zeros\n", | ||
"\n", | ||
"test2 = [1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9] #1x9 matrix\n", | ||
"test3 = [1 2 3 6 5 4 7 8 9] #1x9 matrix for zig zag. length(test3) must = length(test2)\n", | ||
"\n", | ||
"# want to zig zag values. so test will be, at the end of this, \n", | ||
"# 1.1 1.2 1.3\n", | ||
"# 1.6 1.5 1.4\n", | ||
"# 1.7 1.8 1.9\n", | ||
"n = 1; " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "8e48508b", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[1.1 1.2 1.3; 1.4 1.5 1.6; 1.7 1.8 1.9]" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#non zig zag\n", | ||
"for i in 1:3, j in 1:3\n", | ||
" if n <= length(test2)\n", | ||
" test[i,j] += test2[n]\n", | ||
" n += 1\n", | ||
" end\n", | ||
"end\n", | ||
"println(test) # print test to stout hopefully" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "be75f902", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"[1.1 1.2 1.3; 1.6 1.5 1.4; 1.7 1.8 1.9]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#zig zag\n", | ||
"for i in 1:3, j in 1:3\n", | ||
" if n <= length(test3)\n", | ||
" test[i,j] += test2[test3[n]]\n", | ||
" n += 1\n", | ||
" end\n", | ||
"end\n", | ||
"println(test)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Julia 1.8.2", | ||
"language": "julia", | ||
"name": "julia-1.8" | ||
}, | ||
"language_info": { | ||
"file_extension": ".jl", | ||
"mimetype": "application/julia", | ||
"name": "julia", | ||
"version": "1.8.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |