Skip to content

Commit

Permalink
matrix testing history
Browse files Browse the repository at this point in the history
  • Loading branch information
llarrieu committed Mar 1, 2023
1 parent 2b68c59 commit a3586aa
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .ipynb_checkpoints/matrix_testing-checkpoint.ipynb
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
}

0 comments on commit a3586aa

Please sign in to comment.