Simple Arithmetic Operations in octave

I am working on octave-4.0.0 GUI version. Here, we can use simple arithmetic operations on octave

>> a = 20;
>> b = 30;
>> ans = a+b;  // adding two numbers
>> ans
ans =  50

>> ans2 = a*b; // Multiplication of two numbers
>> ans2
ans2 =  600

>> ans3 = a/b; // Division
>> ans3
ans3 =  0.66667

>> a = [1 2;3 4]  // Displaying a matrix
a =

1   2
3   4

>> d = 89  // Assigning value to a variable
d =  89

>> d*2  // Scalar multiplication

ans =  178

>> d/2   // Scalar Division
ans =  44.500

>> [1 2 3 4] // Simple row matrix
ans =

1   2   3   4

1

Advertisements

Published by

kaurdavinder

I am the one who discover myself daily through reading, writing, interacting with people and expressing my thoughts to inspire them if I would be able to bring a little change to the society through my work. I write blogs, participate in various social activities and want to be a Professional Speaker. Currently, I am pursuing my post graduation in Computer Applications from Guru Nanak Dev Engineering College, Ludhiana and I’m very much active in many technical & social communities.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s