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

Prolog programming language - artificial intelligence, Prolog Programming L...

Prolog Programming Language - Artificial intelligence: Most of the programming languages are procedural: the programmer specifies exactly the correct instructions (algorithms)

Version control systems, The next major set of tasks to tackle are delete a...

The next major set of tasks to tackle are delete and update. Version control systems typically version updates to a ?le and only store the differences between the ?les. Two system

Develop the multi agent system, The new season of AFL, and the excited comi...

The new season of AFL, and the excited coming FIFA World Cup in South Africa this June, many sports fans are willing to find the latest results of their beloved sports teams. In th

What is indirect addressing mode explain, Q. What is Indirect Addressing Mo...

Q. What is Indirect Addressing Mode explain? Indirect Addressing Mode In the indirect addressing modes operands employ registers to point to locations in memory. So it is

Illustrate simple ALU organisation, Q. Illustrate Simple ALU Organisation? ...

Q. Illustrate Simple ALU Organisation? An ALU comprises circuits which perform data processing micro-operations. Though how are these ALU circuits used in conjunction of other

Hardware required for superscalar processing, Q. Hardware required for supe...

Q. Hardware required for superscalar processing? For applying superscalar processing a number of special hardware should be offered that is discussed below: • The necessity

Initial considerations in problem solving, Initial considerations in proble...

Initial considerations in problem solving: Three initial considerations in problem solving for easiest(as described in Russell and Norvig):  Initial State  First

Differences between a uri, Question: (a) Describe the differences betwe...

Question: (a) Describe the differences between a URI, a URN and a URL. (b) What are the five basic syntax rules for a well-formed XML document? (c) Provide four uses of

Linux, Explain about unix file system architecture

Explain about unix file system architecture

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