Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
GNU Octave Beginner's Guide
GNU Octave Beginner's Guide

GNU Octave Beginner's Guide: Become a proficient Octave user by learning this high-level scientific numerical tool from the ground up

eBook
$9.99 $28.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

GNU Octave Beginner's Guide

Chapter 2. Interacting with Octave: Variables and Operators

Octave is specifically designed to work with vectors and matrices. In this chapter, you will learn how to instantiate such objects (or variables), how to compare them, and how to perform simple arithmetic with them. Octave also supports more advanced variable types, namely, structures and cell arrays, which we will learn about. With Octave, you have an arsenal of functionalities that enable you to retrieve information about the variables. These tools are important to know later in the book, and we will go through the most important ones.

In detail, we will learn how to:

  • Instantiate simple numerical variables i.e. scalars, vectors, and matrices.

  • Instantiate text string variables.

  • Instantiate complex variables.

  • Retrieve variable elements through simple vectorized expressions.

  • Instantiate structures, cell arrays, and multidimensional arrays.

  • Get information about the variables.

  • Add and subtract numerical variables.

  • Perform matrix products...

Simple numerical variables


In the following, we shall see how to instantiate simple variables. By simple variables, we mean scalars, vectors, and matrices. First, a scalar variable with name a is assigned the value 1 by the command:

octave:1> a=1
a = 1

That is, you write the variable name, in this case a, and then you assign a value to the variable using the equal sign. Note that in Octave, variables are not instantiated with a type specifier as it is known from C and other lower-level languages. Octave interprets a number as a real number unless you explicitly tell it otherwise1.

You can display the value of a variable simply by typing the variable name:

octave:2>a
a = 1

Let us move on and instantiate an array of numbers:

octave:3 > b = [1 2 3]
b =
1 2 3

Octave interprets this as the row vector:

(2.1)

rather than a simple one-dimensional array. The elements (or the entries) in a row vector can also be separated by commas, so the command above could have been:

octave:3> b = [1,...

Time for action - manipulating arrays


  1. 1. To delete the second column in A, we use:

octave:14> A(:,2) = []
A =
1 3
1 3
  1. 2. We can extend an existing array, for example:

octave:15 > b = [b 4 5]
b =
1 2 3 4 5
  1. 3. Finally, try the following commands:

octave:16> d = [2 4 6 8 10 12 14 16 18 20]
d =
2 4 6 8 10 12 14 16 18 20
octave:17> d(1:2:9)
ans =
2 6 10 14 18
octave:18> d(3:3:12) = -1
d =
2 4 -1 8 10 -1 14 16 -1 20 0 -1

What just happened?

In Command 14, Octave interprets [] as an empty column vector and column 2 in A is then deleted in the command. Instead of deleting a column, we could have deleted a row, for example as an empty column vector and column 2 in A is then deleted in the command.

octave:14> A(2,:)=[]

On the right-hand side of the equal sign in Command 15, we have constructed a new vector given by [b 4 5], that is, if we write out b, we get [1 2 3 4 5] since b=[1 2 3]. Because of the equal sign, we assign the variable b to this vector and delete the existing value...

Structures and cell arrays


In many real life applications, we have to work with objects that are described by many different types of variables. For example, if we wish to describe the motion of a projectile, it would be useful to know its mass (a scalar), current velocity (a vector), type (a string), and so forth. In Octave, you can instantiate a single variable that contains all this information. These types of variables are named structures and cell arrays.

Structures

A structure in Octave is like a structure in C—it has a name, for example projectile, and contains a set of fields3 that each has a name, as shown in the following figure:

We can refer to the individual structure field using the.character:

structurename.fieldname

where structurename is the name of the structure variable, and fieldname is (as you may have guessed) the field's name.

3or members in C terminology

To show an example of a structure, we can use the projectile described above. Let us therefore name the structure variable...

Time for action - instantiating a structure


  1. 1. To set the projectile mass, we can use:

octave:32>projectile.mass = 10.1
projectile =
{
mass = 10.100
}
  1. 2. The velocity field is set in a similar fashion:

octave:33>projectile.velocity = [1 0 0]
projectile =
{
mass = 10.100
velocity =
0 0
}
  1. 3. We can also set the text field as usual:

octave:34>projectile.type = "Cannonball"
projectile =
{
mass = 10.100
velocity =
1 0 0
type = Cannonball
}

and so on for position and whatever else could be relevant.

What just happened?

Command 32 instantiates a structure variable with the name projectile by assigning a field named mass the value 10.100. At this point, the structure variable only contains this one field.

In Commands 33 and 34, we then add two new fields to the structure variable. These fields are named velocity and type. It is, of course, possible to keep adding new fields to the structure.

Instead of typing in one structure field at a time, you can use the struct function. (In the next chapter...

Time for action - instantiating a cell array


  1. 1. To instantiate a cell array with the same data as the projectile structure above, we can use:

octave:44> projectile = {10.1, [1 0 0], "Cannonball"}
projectile =
{
[1,1] = 10.1
[1,2] =
1 0 0
[1,3] = Cannonball
}
  • The numbers in the square brackets are then the row indices and column indices, respectively.

  1. 2. To access a cell, you must use curly brackets:

octave:45> projectile{2}
ans =
1 0 0
  1. 3. You can have two-dimensional cell arrays as well. For example:

octave:46> projectiles = {10.1, [1 0 0], "Cannonball"; 1.0, [0 0 0], "Cartridge"}
projectile =
{
[1, 1] = 10.100
[2, 1] = 1
[1, 2] =
1 0 0
[2, 2] =
0 0 0
[1, 3] = Cannonball
[2, 3] = Cartridge
}
  1. 4. To access the values stored in the cell array, simply use:

octave:47> projectiles{2,3}
ans = Cartridge

What just happened?

Command 44 instantiates a cell array with one row and three columns. The first cell contains the mass, the second cell the velocity, and the third cell the string "Cannonball...

Getting information


In this section, we will learn how to obtain information about the variables that have been instantiated. This is particularly useful when you have forgotten the names, sizes, or when you have loaded data from files (more on the latter in Chapter 4).

Time for action - using whos


We are working with quite a few variables now. We can list them all with whos:

octave:48>whos
Variables in the current scope:

Attr

Name

Size

Bytes

 

Class

====

====

====

=====

 

=====

 

A

2x2

32

 

double

 

B

2x2x2

128

 

double

 

T

2x6

12

 

char

 

Z

2x2

64

 

double

 

a

1x1

8

 

double

 

ans

1x9

9

 

char

 

b

1x5

40

 

double

 

c

3x1

24

 

double

 

d

1x12

96

 

double

 

projectile

1x3

42

 

cell

 

projectiles

2x3

83

 

cell

 

s

1x2

83

 

struct

 

t

1x11

11

 

char

 

z

1x1

16

 

double

Total is 81 elements using 648 bytes

What just happened?

As seen above, whos prints out five columns. The first column can have values g or p, which means that the variable is global or persistent. We shall return to what these qualifiers mean in Chapter 5. In our case, all the variables are what are named local, which is not stated explicitly by the command whos. A local variable is characterized by being visible and therefore accessible to a given workspace...

A few things that make life easier


Imagine that you wish to generate a sequence of numbers in the interval -2.1 to 0.5 (including -2.1 and 0.5) with an incremental spacing of 0.2. This is rather tedious to do by hand and is very error prone, because it involves typing a lot of digits. Fortunately, Octave provides you with a very convenient way to do this (note that we now assign the variable b a new value):

octave:60> b = [-2.1:0.2:0.5]
b =
Columns 1 through 7
-2.1000 -1.9000 -1.7000 -1.5000 -1.3000 -1.1000 -0.9000
Columns 8 through 14
-0.7000 -0.5000 -0.3000 -0.1000 0.1000 0.3000 0.5000

If we had done this by hand instead, we should have typed in:

octave:61> size(b)
ans =
1 14

14 numbers. You can also use negative increments if the interval starting value is larger than the end value. If you do not provide an incremental value, Octave assumes 1.

An important point is that if we have chosen an increment of, say 0.4, in Command 60, Octave will give us a number sequence starting from ...

Basic arithmetic


Octave offers easy ways to perform different arithmetic operations. This ranges from simple addition and multiplication to very complicated linear algebra. In this section, we will go through the most basic arithmetic operations, such as addition, subtraction, multiplication, and left and right division. In general, we should think of these operations in the framework of linear algebra and not in terms of arithmetic of simple scalars.

Addition and subtraction

We begin with addition.

Time for action - doing addition and subtraction operations


  1. 1. I have lost track of the variables! Let us start afresh and clear all variables first:

octave:66> clear
  • (Check with whos to see if we cleared everything).

  1. 2. Now, we define four variables in a single command line(!)

octave:67> a = 2; b=[1 2 3]; c=[1; 2; 3]; A=[1 2 3; 4 5 6];
  • Note that there is an important difference between the variables b and c; namely, b is a row vector, whereas c is a column vector.

  1. 3. Let us jump into it and try to add the different variables. This is done using the + character:

octave:68>a+a
ans = 4
octave:69>a+b
ans =
3 4 5
octave:70>b+b
ans =
2 4 6
octave:71>b+c
error: operator +: nonconformant arguments (op1 is 1x3, op2 is 3x1)

Note

It is often convenient to enter multiple commands on the same line. Try to test the difference in separating the commands with commas and semicolons.

What just happened?

The output from Command 68 should be clear; we add the scalar a with itself. In Command 69...

Time for action - doing multiplication operations


Let us try to perform some of the same operations for multiplication as we did for addition:

octave:75> a*a
ans = 4
octave:76> a*b
ans =
2 4 6
octave:77> b*b
error: operator *: nonconformant arguments (op1 is 1x3, op2 is 1x3)
octave:78> b*c
ans = 14

What just happened?

From Command 75, we see that * multiplies two scalar variables just like standard multiplication. In agreement with linear algebra, we can also multiply a scalar by each element in a vector as shown by the output from Command 76. Command 77 produces an error—recall that b is a row vector which Octave also interprets as a 1 x 3 matrix, so we try to perform the matrix multiplication (1 x 3)(1 x 3), which is not valid. In Command 78, on the other hand, we have (1 x 3)(3 x 1) since c is a column vector yielding a matrix with size 1 x 1, that is, a scalar. This is, of course, just the dot product between b and c.

Let us try an additional example and perform the matrix...

Time for action - doing left and right division


  1. 1. We need to instantiate the coefficient matrix A and vector y first:

octave:93> A=[2 1 -3; 4 -2 -2; -1 0.5 -0.5]; y = [1; 3; 1.5];
  1. 2. The solution to the linear equation system, Equation (2.6), is then found directly via the command:

octave:94> A\y
ans =
-1.6250
-2.5000
-2.2500
  • Easy!

What just happened?

It should be clear what happened. In Command 93, we instantiated the matrix A and the vector y that define the linear equation system in Equation (2.6). We then solve this system using the left division operator. Later in Chapter 6, we will investigate how the left division operator performs for very large systems.

Let us try the right division operator, even though we know that it will cause problems:

octave:95> A/y
error: operator /: nonconformant arguments (op1 is 3x3, op2 is 3x1)

We see the expected error message. The right division operator will, however, work in the following command:

octave:96> A/A
ans =
1.0000 -0.0000 -0.0000...

Comparison operators and precedence rules


In the previous section, we discussed the basic arithmetic operations. In this section, we will learn how to compare different variables. Octave (like many other programming languages) uses very intuitive operator characters for this. They are:

x==y

Evaluates to true if x equals y

x>y

Evaluates to true if x is larger than y

x<y

Evaluates to true if x is smaller than y

x>=y

Evaluates to true if x is greater than or equal to y

x<=y

Evaluates to true if x is smaller than or equal to y

x!=y

Evaluates to true if x is not equal to y

For Octave's comparison operators, true is equivalent to a non-zero value and false is equivalent to 0. Let us see a few examples—recall the matrix A from Command 93:

octave:108> A(2,1) == 1
ans = 1
octave:109>A(2,1) == 2
ans = 0
octave:110> A(2,1) > 0
ans = 1
octave:111> A(2,1) != 4
ans = 1

Instead of using != for "not equal to", you can use ~=.

You may be familiar...

Time for action - working with precedence rules


  1. 1. Let us see an example:

octave:117> A*y + a
ans =
2.5000
-3.0000
1.7500
  • Here, Octave first performs the matrix multiplication between A and y, and then adds a to that result. We say that multiplication has higher precedence than addition.

  1. 2. Let us try two other examples:

octave:118> A*y.^2
ans =
4.2500
-18.5000
2.3750
octave:119> (A*y).^2
ans =
0.2500
25.0000
0.0625

What just happened?

In command 118, because the .^ operator has higher precedence than *, Octave first calculates element-wise power operation y.^2, and then performs the matrix multiplication. In command 190, by applying parenthesis, we can perform the matrix multiplication first, and then do the power operation on the resulting vector.

Note

The precedence rules are given below for the operators that we have discussed in this chapter:

When in doubt, you should always use parenthesis to ensure that Octave performs the computations in the order that you want.

Pop quiz - understanding...

A few hints


Instead of using the left division operator to solve a linear equation system, you can do it "by hand". Let us try this using the equation system given by Equation (2.6) with the solution given in Equation (2.9). First we need to calculate the inverse of A (which exists). This is done via the inv function:

octave:120>inverse_A = inv(A)
inverse_A =
0.2500 -0.1250 -1.0000
0.5000 -0.5000 -1.0000
0.0000 -0.2500 -1.0000

We can now simply perform the matrix multiplication A 1y to get the solution:

octave:121>inverse_A*y
ans =
-1.6250
-2.5000
-2.2500

This output is similar to the output from Command 94. Now, when Octave performs the left division operation, it does not first invert A and then multiply that result with y. Octave has many different algorithms it can use for this operation, depending on the specific nature of the matrix. The results from these algorithms are usually more precise and much quicker than performing the individual steps. In this particular example, it...

Summary


We went through a lot of the basics in this chapter! Specifically, we learned:

  • How to instantiate scalar, vector, and matrix variables.

  • How to instantiate complex variables.

  • How to instantiate a text string.

  • How to access and change the values of array elements.

  • About structures, cell arrays, and multidimensional arrays.

  • How to retrieve important information about the variables.

  • How to add and subtract vectors and matrices.

  • About matrix multiplication.

  • Solving linear equation systems.

  • How to compare scalars, vectors, and matrices.

  • Some additional helpful functionality.

  • Precedence rules.

In the next chapter, we will learn about Octave functions and how to do plotting. We shall make use of many of the things that we have just learned in this chapter.

Left arrow icon Right arrow icon

Key benefits

  • The easiest way to use GNU Octave's power and flexibility for data analysis
  • Work with GNU Octave's interpreter ‚Äì declare and control mathematical objects like vectors and matrices
  • Rationalize your scripts and control program flow
  • Extend GNU Octave and implement your own functionality
  • Get to know the vast built-in functionality that GNU Octave has to offer
  • Build your own GNU Octave toolbox package to solve complex problems
  • Learn Octave the simple way, with real-world examples and plenty of screenshots provided throughout the book

Description

Today, scientific computing and data analysis play an integral part in most scientific disciplines ranging from mathematics and biology to imaging processing and finance. With GNU Octave you have a highly flexible tool that can solve a vast number of such different problems as complex statistical analysis and dynamical system studies.The GNU Octave Beginner's Guide gives you an introduction that enables you to solve and analyze complicated numerical problems. The book is based on numerous concrete examples and at the end of each chapter you will find exercises to test your knowledge. It's easy to learn GNU Octave, with the GNU Octave Beginner's Guide to hand.Using real-world examples the GNU Octave Beginner's Guide will take you through the most important aspects of GNU Octave. This practical guide takes you from the basics where you are introduced to the interpreter to a more advanced level where you will learn how to build your own specialized and highly optimized GNU Octave toolbox package. The book starts by introducing you to work variables like vectors and matrices, demonstrating how to perform simple arithmetic operations on these objects before explaining how to use some of the simple functionality that comes with GNU Octave, including plotting. It then goes on to show you how to write new functionality into GNU Octave and how to make a toolbox package to solve your specific problem. Finally, it demonstrates how to optimize your code and link GNU Octave with C and C++ code enabling you to solve even the most computationally demanding tasks. After reading GNU Octave Beginner's Guide you will be able to use and tailor GNU Octave to solve most numerical problems and perform complicated data analysis with ease.

Who is this book for?

This book is intended for anyone interested in scientific computing and data analysis. The reader should have a good level of mathematics and a basic understanding of programming will be useful, although it is not a prerequisite.

What you will learn

  • Work with the Octave interpreter
  • Declare and control different variable types
  • Use arithmetic operations between variables
  • Use logical operations
  • Control the program flow
  • Write scripts
  • Implement new functions
  • Perform complex data analysis
  • Write your own toolbox package
  • Optimize your code
Estimated delivery fee Deliver to Russia

Economy delivery 10 - 13 business days

$6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 21, 2011
Length: 280 pages
Edition : 1st
Language : English
ISBN-13 : 9781849513326
Category :
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Russia

Economy delivery 10 - 13 business days

$6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Jun 21, 2011
Length: 280 pages
Edition : 1st
Language : English
ISBN-13 : 9781849513326
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 92.98
gnuplot Cookbook
$43.99
GNU Octave Beginner's Guide
$48.99
Total $ 92.98 Stars icon
Banner background image

Table of Contents

8 Chapters
Introducing GNU Octave Chevron down icon Chevron up icon
Interacting with Octave: Variables and Operators Chevron down icon Chevron up icon
Working with Octave: Functions and Plotting Chevron down icon Chevron up icon
Rationalizing: Octave Scripts Chevron down icon Chevron up icon
Extensions: Write Your Own Octave Functions Chevron down icon Chevron up icon
Making Your Own Package: A Poisson Equation Solver Chevron down icon Chevron up icon
More Examples: Data Analysis Chevron down icon Chevron up icon
Need for Speed: Optimization and Dynamically Linked Functions Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2
(19 Ratings)
5 star 47.4%
4 star 26.3%
3 star 21.1%
2 star 5.3%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Mar 10, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good for the questions posed. Yet to go through completely.
Amazon Verified review Amazon
TB (aus) Nov 08, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I was very surprised by this book having tinkered with Octave since '96 so I was inspired to write a review.Best of all it is written specifically for Octave and I have learnt new tricks that would be hard pick up from the official documentation, which is mainly a reference. The book has a text book style with simple examples to teach good scripting techniques and the latest graphics commands. It is quite general and doesn't focus on specialised (hard core Math, Stats, Engineering) functions that come with Octave, as that's what the official documentation is for.I highly recommended getting this relatively cheap book as it will save you hours of time cross-checking between the official 'GNU Octave' documentation, the numerous Howtos, Lecture Notes, summary sheets scattered on the Net, many of which are now outdated and M@lab books just to get things going.
Amazon Verified review Amazon
Mark A. Lytle Apr 04, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a good guide for someone with previous programming experience (at least some) or undergraduates with a math background who want to learn to use computers as a powerful math tool.The structure is well thought out, and the explanations are generally clear. The examples are well chosen also. I find myself hoping that Mr. Hanson might come out with a sequel, as Octave is rich enough to be worth more than one book.Octave is the free, open source alternative to Matlab, and will run many of the same scripts. With this entry, Octave shows it has matured, and has some momentum. I have spent about 2 weeks with this book and have only covered perhaps half of it's topics, but it is far more accessible then most college textbooks. I do recommend it for your bookshelf.
Amazon Verified review Amazon
Lugo Nov 06, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Su contenido es basico pero muy explicito en todo, muy practico y con todo lo necesario para comenzar a utilizar octave.
Amazon Verified review Amazon
Mouli Jul 03, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Best out of possibly only few books on GNU Octave. Good organization of concepts
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela