Created
July 5, 2020 11:40
-
-
Save genkuroki/ecb6e711877ce266408b5c51a0f76109 to your computer and use it in GitHub Desktop.
= and .=
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
{ | |
"cells": [ | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "@show A = zeros(4)\n@show B = Float64[1, 2, 3, 4]\n\nA .= B\n\n@show A\n\nA[2] = 20\n@show A\n@show B;", | |
"execution_count": 1, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "A = zeros(4) = [0.0, 0.0, 0.0, 0.0]\nB = Float64[1, 2, 3, 4] = [1.0, 2.0, 3.0, 4.0]\nA = [1.0, 2.0, 3.0, 4.0]\nA = [1.0, 20.0, 3.0, 4.0]\nB = [1.0, 2.0, 3.0, 4.0]\n", | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "@show A = zeros(4)\n@show B = Float64[1, 2, 3, 4]\n\nA = B\n\n@show A\n\nA[2] = 20\n@show A\n@show B;", | |
"execution_count": 2, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "A = zeros(4) = [0.0, 0.0, 0.0, 0.0]\nB = Float64[1, 2, 3, 4] = [1.0, 2.0, 3.0, 4.0]\nA = [1.0, 2.0, 3.0, 4.0]\nA = [1.0, 20.0, 3.0, 4.0]\nB = [1.0, 20.0, 3.0, 4.0]\n", | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "@show A = zeros(4)\n@show B = Float64[1, 2, 3, 4]\n\nA = copy(B)\n\n@show A\n\nA[2] = 20\n@show A\n@show B;", | |
"execution_count": 3, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "A = zeros(4) = [0.0, 0.0, 0.0, 0.0]\nB = Float64[1, 2, 3, 4] = [1.0, 2.0, 3.0, 4.0]\nA = [1.0, 2.0, 3.0, 4.0]\nA = [1.0, 20.0, 3.0, 4.0]\nB = [1.0, 2.0, 3.0, 4.0]\n", | |
"name": "stdout" | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "", | |
"execution_count": null, | |
"outputs": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"name": "julia-1.4", | |
"display_name": "Julia 1.4.2", | |
"language": "julia" | |
}, | |
"toc": { | |
"nav_menu": {}, | |
"number_sections": true, | |
"sideBar": true, | |
"skip_h1_title": false, | |
"base_numbering": 1, | |
"title_cell": "Table of Contents", | |
"title_sidebar": "Contents", | |
"toc_cell": false, | |
"toc_position": {}, | |
"toc_section_display": true, | |
"toc_window_display": false | |
}, | |
"language_info": { | |
"file_extension": ".jl", | |
"name": "julia", | |
"mimetype": "application/julia", | |
"version": "1.4.2" | |
}, | |
"@webio": { | |
"lastKernelId": null, | |
"lastCommId": null | |
}, | |
"gist": { | |
"id": "ecb6e711877ce266408b5c51a0f76109", | |
"data": { | |
"description": "= and .=", | |
"public": true | |
} | |
}, | |
"_draft": { | |
"nbviewer_url": "https://gist.github.com/ecb6e711877ce266408b5c51a0f76109" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment