Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Getting started with Julia Programming Language
  • Table Of Contents Toc
Getting started with Julia Programming Language

Getting started with Julia Programming Language

By : Ivo Balbaert
4.1 (17)
close
close
Getting started with Julia Programming Language

Getting started with Julia Programming Language

4.1 (17)
By: Ivo Balbaert

Overview of this book

This book is for you if you are a data scientist or working on any technical or scientific computation projects. The book assumes you have a basic working knowledge of high-level dynamic languages such as MATLAB, R, Python, or Ruby.
Table of Contents (14 chapters)
close
close
12
A. List of Macros and Packages
13
Index

User-defined and composite types

In Julia, as a developer, you can define your own types to structure data used in applications. For example, if you need to represent points in a three-dimensional space, you can define a type Point as follows:

# see the code in Chapter 6\user_defined.jl:
type Point
    x::Float64
    y::Float64
    z::Float64
end

The type Point is a concrete type, objects of this type can be created as p1 = Point(2, 4, 1.3), and it has no subtypes: typeof(p1) returns Point (constructor with 2 methods), subtypes(Point) returns 0-element Array{Any,1}.

Such a user-defined type is composed of a set of named fields with an optional type annotation; that's why it is a composite type, and its type is also DataType. If the type of a named field is not given, then it is Any. A composite type is similar to a struct in C or a class without methods in Java.

Unlike in other object-oriented languages such as Python or Java, where you call a function on an object such as object.func...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Getting started with Julia Programming Language
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon