Julia cheatsheet

© All Rights Reserved

42 views

Julia cheatsheet

© All Rights Reserved

- amca2009_1
- BC0043 COMPUTER ORIENTED NUMERICAL METHODS PAPER 1
- 618883223
- file_down
- Matrices Example with Mathematica
- Ahp
- 10.1.1.19
- Chapter 0
- Analytical Hierarchy Process
- list_IA
- IJAIEM-2013-06-06-014
- Eigenvalue Eigenvector
- Lect5 Math AHP
- Ahp
- Fitting protein structures
- Population
- METODOS.pdf
- Mathematical Physics
- [MATRIKS & VEKTOR] - - UNSW - Essential Mathematical Skills (2002) Barry & Davis
- QRG_CE.pdf

You are on page 1of 1

xxx at MIT)

Basics: Arithmetic and functions of numbers:

julialang.org — documentation; juliabox.com— run Julia online 3*4, 7+4, 2-6, 8/3 mult., add, sub., divide numbers

github.com/stevengj/julia-mit installation & tutorial 3^7, 3^(8+2im) compute 37 or 38+2i power

using IJulia; IJulia.notebook() start IJulia browser

sqrt(-5+0im) −5 as a complex number

shift-return execute input cell in IJulia exp(12) e12

log(3), log10(100) natural log (ln), base-10 log (log10)

Defining/changing variables: abs(-5), abs(2+3im) absolute value |–5| or |2+3i|

x = 3 define variable x to be 3 €

sin(5pi/3) compute sin(5π/3)

x = [1,2,3] array/“column”-vector (1,2,3) besselj(2,6) compute Bessel function J2(6)

y = [1 2 3] 1×3 matrix (1,2,3)

A = [1 2 3 4; 5 6 7 8; 9 10 11 12]

—set A to 3×4 matrix with rows 1,2,3,4 etc. Arithmetic and functions of vectors and matrices:

x[2] = 7 change x from (1,2,3) to (1,7,3) x * 3, x + 3 multiply/add every element of x by 3

A[2,1] = 0 change A2,1 from 5 to 0 x + y element-wise addition of two vectors x and y

u, v = (15.03, 1.2e-27) set u=15.03, v=1.2×10–27 A*y, A*B product of matrix A and vector y or matrix B

f(x) = 3x define a function f(x) x * y not defined for two vectors!

x -> 3x an “anonymous” function x .* y element-wise product of vectors x and y

x .^ 3 every element of x is cubed

cos.(x), cos.(A) cosine of every element of x or A

Constructing a few simple matrices: exp.(A), expm(A) exp of each element of A, matrix exp eA

rand(12), rand(12,4) random length-12 vector or 12×4 matrix xʹ, Aʹ conjugate-transpose of vector or matrix

with uniform random numbers in [0,1)

x’*y, dot(x,y), sum(conj(x).*y) three ways to compute x · y

randn(12) Gaussian random numbers (mean 0, std. dev. 1)

A \ b, inv(A) return solution to Ax=b, or the matrix A–1

eye(5) 5×5 identity matrix I

λ, V = eig(A) eigenvals λ and eigenvectors (columns of V) of A

linspace(1.2,4.7,100) 100 equally spaced points from 1.2 to 4.7

diagm(x) matrix whose diagonal is the entries of x

Plotting (type using PyPlot first)

plot(y), plot(x,y) plot y vs. 0,1,2,3,… or versus x

Portions of matrices and vectors:

loglog(x,y), semilogx(x,y), semilogy(x,y) log-scale plots

x[2:12] the 2nd to 12th elements of x

title(“A title”), xlabel(“x-axis”), ylabel(“foo”) set labels

x[2:end] the 2nd to the last elements of x

legend([“curve 1”, “curve 2”], “northwest”) legend at upper-left

A[5,1:3] row vector of 1st 3 elements in 5th row of A

grid(), axis(“equal”) add grid lines, use equal x and y scaling

A[5,:] row vector of 5th row of A

title(L”the curve $e^\sqrt{x}$”) title with LaTeX equation

diag(A) vector of diagonals of A

savefig(“fig.png”), savefig(“fig.pdf”) save PNG or PDF image

- amca2009_1Uploaded byTheresa Newman
- BC0043 COMPUTER ORIENTED NUMERICAL METHODS PAPER 1Uploaded bySeekEducation
- 618883223Uploaded byDapinder Singh
- file_downUploaded byleep123
- Matrices Example with MathematicaUploaded byBogdan Tanasoiu
- AhpUploaded byTanviSheikh
- 10.1.1.19Uploaded byandhra2003
- Chapter 0Uploaded byOng Soonzheng
- Analytical Hierarchy ProcessUploaded byChristian Harijanto
- list_IAUploaded bydepalmas
- IJAIEM-2013-06-06-014Uploaded byAnonymous vQrJlEN
- Eigenvalue EigenvectorUploaded bydibyodibakar
- Lect5 Math AHPUploaded byHicham Asbat
- AhpUploaded byBilal Ajjaa
- Fitting protein structuresUploaded bymnstn
- PopulationUploaded byAne Garcia-Junco
- METODOS.pdfUploaded byPatricia Calvo Pérez
- Mathematical PhysicsUploaded byMichael Pearson
- [MATRIKS & VEKTOR] - - UNSW - Essential Mathematical Skills (2002) Barry & DavisUploaded byApril
- QRG_CE.pdfUploaded byckvirtualize
- scilabUploaded byAngeloLorenzoSalvadorTamayo
- hw2-StPh2-2015Uploaded byAhui Chung
- Similar MatricesUploaded bybbscribed
- ControlUploaded byMona Ali
- Linear Algrebra PracticeUploaded byLouieLam
- 31. the Optimum Location of Outrigger in Reducing the Along-wind and Across-wind Responses of Tall BuildingsUploaded byBriando
- Cushing-An Introduction to Structured Population DynamicsUploaded byMarluci Galindo
- Lecture_Notes_2017-2018(2).pdfUploaded byFaris Ahmad Fadzil
- 1009.4119Uploaded byFhjjFghgyhffghhg
- Answers to Fluids ExamsUploaded bymills_maddy

- Case Study-Chatter IssueUploaded bymbrijbhushan4863
- Force feedback linearization for higher-order electromechanical sigma–delta modulatorsUploaded bymbrijbhushan4863
- Introduction to Bond-Graph theoryUploaded bymbrijbhushan4863
- Breedveld_01_BGFundamentalsUploaded byGordana Janevska
- LabVIEW Design PatternsUploaded bymbrijbhushan4863
- 2008-CIRP Annals OzelUploaded bymbrijbhushan4863
- beameruserguide.pdfUploaded byAnonymous VVzVhRJ
- Conversational Programming v2Uploaded bymbrijbhushan4863
- ACC_slides_MHE_v1.pdfUploaded bymbrijbhushan4863
- Introduction SPCUploaded byMitul
- Microstepping detailsUploaded bymbrijbhushan4863
- New USA VISA ChecklistUploaded bymbrijbhushan4863
- In-Process Diagnostics for GrindingUploaded bymbrijbhushan4863
- project schedulingUploaded bysuganyababumba
- Focas ContentsUploaded bymbrijbhushan4863
- Industry Expectations-1Uploaded bymbrijbhushan4863
- Control Type DifferanceUploaded bymbrijbhushan4863
- Clad Exam Prep Guide EnglishUploaded bymeetnature
- To Invest or Not to Invest in a Capital EquipmentUploaded bymbrijbhushan4863
- GUI.pptUploaded bymbrijbhushan4863
- ch06Uploaded byBilal Hussain Soomro
- Tabla de Carta de ControlUploaded byKeyLa MaEstre RiCaurte
- Chatter – Origin and SuppressionUploaded bymbrijbhushan4863
- Intelligent Data Base for Grinding OperationsUploaded bymbrijbhushan4863

- 1-s2.0-S187661021500541X-mainUploaded bysharma DVSAS
- Professional Ethics Question BankUploaded byJayagopal Jai
- F9FM-Mock1-Qs_d08Uploaded byErclan
- kra-kpi_report_628.xlsUploaded byAnonymous 9LBKih1Y
- cow based economy-.pptxUploaded byChandra Sekhar Gajula
- SSRN-id1418321 MEadUploaded bySaurav Patro
- OP44Uploaded byapi-3709098
- 2012_Marine-AC.com_Cruisair_Price_BookUploaded byiBusinessLogic
- Appendix 25 VDA 6 3 Process AuditUploaded byanbuskp
- Oil & Gas Separation Book 2.pdfUploaded byMahathir Che Ap
- KAT0842-0003-E Enclosed Conductor Rail BoxLineUploaded byMarthaJiménezSánchez
- Yamaha Fazer 1000 Service Manual PartsUploaded byIgor Majksner
- Pwc Introduction Locked Box Closing Mechanism 2014 01 EnUploaded byAnonymous 45z6m4eE7p
- Fuel Cells in StormsUploaded byteju2812
- 5.11. Characters Section in MonographsUploaded bySanthosh Kumar
- Chal Huahua ChoUploaded byWilian Ñahui Quispe
- VILLARAZA-FILCROUploaded byKwesi Delgado
- 37283584 35949705 Electrical CalculationsUploaded byMourad Benderradji
- Project Proposal TEMPLATE in SE Repaired)Uploaded byKenneth Javier
- ReadmeUploaded byVilcu George-Gabriel
- Disaster ManagementUploaded bySoumya Madhusmita
- ACER Report on the Implementation of the Balancing Network CodeUploaded byPasquale Cutri
- Asean Economic Community... One Vision, One Identity, One CommunityUploaded byIan Lam
- 2004v10_in_the_beginning.pdfUploaded byamachmouchi
- A Study on Online Consumer Behivior in Surat CityUploaded byMadhav Lankapati
- english k6 asm1Uploaded byapi-260443196
- InterviewUploaded byapi-3827976
- Pricing PolicyUploaded byDeogracious Chawira
- TVRI Media Profile Eng VersionUploaded bytinusbowo
- proj1_2007FUploaded bysachinags

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.