Subsequent statements set every element of matrix, Computer Engineering

Assignment Help:

Q. Subsequent statements set every element of matrix?

Let a= [2,4,6,8,10], b=[1,3,5,7,9], c=[0,0,0,0,0]

Consider the subsequent program section

FORALL (i = 2:4)

  a(i) = a(i-1)+a(i+1)

  c(i) = b(i) *a(i+1).

END FORALL

The calculations would be:

   a[2] =a[1]+a[3] =2+6=8

   a[3] =a[2]+a[4] =4+8=12

   a[4] =a[3]+a[5] = 6+10=16

   c[2] = b[2] *a[3] = 3*12=36

   c[3] = b[3] *a[4] = 5*16=80

   c[4] = b[4] *a[5] =7*10=70

So output is

a= [2,8,12,16,10], b=[1,3,5,7,9], c=[0,36,80,70,0]


Related Discussions:- Subsequent statements set every element of matrix

Explain the typical functions of operating systems, List the typical functi...

List the typical functions of operating systems. Classical functions of operating system are given as: (1) Process management: A process is a program throughout execution.

Robotics, Based on the disciplines of engineering, AI and physiology robo...

Based on the disciplines of engineering, AI and physiology robotics is concerned with building robot machines with physical capabilities akin to human beings which are cont

Write an algorithm for deadlock detection, Write an algorithm for deadlock ...

Write an algorithm for deadlock detection. An algorithm for deadlock detection: 1. Assume that Work and Finish be vectors of length m and n, correspondingly. Initialize:

Determine capacity in bytes of a certain memory, A certain memory has a cap...

A certain memory has a capacity of 4K × 8 (i)  How many data input and data output lines does it have? (ii) How many address lines does it have? (iii) What is its capacity in bytes

Cim and holonic manufacturing system, CIM and Holonic Manufacturing System ...

CIM and Holonic Manufacturing System The improvement of computer integrated manufacturing has demonstrated that the automation has the same potential such that of computers in

What is the difference between activity and sequence diagram, The following...

The following are the difference among Activity and Sequence Diagrams: A sequence diagram represents the way of processes implement in a sequence. For example, the order of op

Give difference between assembler and compiler, Give difference between ass...

Give difference between assembler and compiler. Assembler: It is the translator for an assembly language of computer. An assembly language is a low-level programming language

What is an i/o channel, What is an I/O channel?  An I/O channel is actu...

What is an I/O channel?  An I/O channel is actually a special purpose processor, also known as peripheral processor. The main processor initiates a transfer by passing the need

PADOVAN STRING, write a program that counts the number of occurrences of th...

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n)

What is a daemon, What is a Daemon? A daemon is a method that detaches ...

What is a Daemon? A daemon is a method that detaches itself from the terminal and runs, disconnected, in the background, waiting for requests and responding to them. It can als

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd