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

Determine the concepts of object oriented analysis, Determine the concepts ...

Determine the concepts of Object Oriented Analysis  In OOA the initial focus is on identifying objects from the application domain, after that fitting those procedures around

Datastructure, deque insertion and deletion ..

deque insertion and deletion ..

An 8086 interrupt, An 8086 interrupt can take placedue to the following rea...

An 8086 interrupt can take placedue to the following reasons: 1.  Hardware interrupts caused by some external hardware device. 2.  Software interrupts that can be invoked wit

Define the state and instance of properties of object, Define the state and...

Define the state and instance of properties of object A state encompasses all properties of object along with values of each of these properties. An instance is a concr

Explain the term - ancestors, Explain the term - ancestors The ancestor...

Explain the term - ancestors The ancestors of modern age computer were mechanical and electro-mechanical instruments. This ancestry can be traced as back and seventeenth centur

Differentiate between exception and validation testing, Differentiate betwe...

Differentiate between exception and validation testing. - Validation testing is done to test the software in conformance to the needs specified. It aims to demonstrate that the

Why does microprocessor contain rom chips?, Microprocessor have ROM chip be...

Microprocessor have ROM chip because it have instructions to implement data. It have the monitor program which not only include implementation instruction but also interfacing

Define the programmable logic devices (pld), Define the Programmable logic ...

Define the Programmable logic devices (PLD)? In the world of digital electronic systems there are three essential kinds of devices 1.memory, 2.microprocessors, and 3.logic. The

Illustration of a demon program, Q. Illustration of a demon program? Wh...

Q. Illustration of a demon program? When the PVM initialize it inspects the virtual machine in that it's to operate and creates a process known as PVM demon or simply pvmd on e

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