From a3586aa57092346d539ab2582077d9cc74ba4956 Mon Sep 17 00:00:00 2001 From: llarrieu Date: Wed, 1 Mar 2023 15:11:06 -0700 Subject: [PATCH] matrix testing history --- .../matrix_testing-checkpoint.ipynb | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .ipynb_checkpoints/matrix_testing-checkpoint.ipynb diff --git a/.ipynb_checkpoints/matrix_testing-checkpoint.ipynb b/.ipynb_checkpoints/matrix_testing-checkpoint.ipynb new file mode 100644 index 0000000..2cc062e --- /dev/null +++ b/.ipynb_checkpoints/matrix_testing-checkpoint.ipynb @@ -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 +}