Add Two Arrays Together

From DavinciWiki
Jump to: navigation, search

Description

This procedure is one of the most basic things that can be done in davinci. Two different arrays will be created and then added together.

Be aware that these operations can be done with multiplication, division and subtraction too.

Procedure

Creates an array of 3x3 filled with 1s and stores it in a variable "a"

 dv> a=clone(1,3,3,1)
 3x3x1 array of int, bsq format [100 bytes]
 1       1       1 
 1       1       1
 1       1       1

Creates an array of 3x3 filled with 2s and stores it in a variable "b"

 dv> b=clone(2,3,3,1)
 3x3x1 array of int, bsq format [100 bytes]
 2       2       2
 2       2       2
 2       2       2

Adds a and b and stores the result in a new variable "c"

 dv> c=a+b
 3x3x1 array of int, bsq format [100 bytes]
 3       3       3
 3       3       3
 3       3       3

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Functions Used

Personal tools