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

Define a socket, Define a socket? An application program interface give...

Define a socket? An application program interface gives the details of how can an application program interacts along with protocol software. But socket API is a defacto standa

Explain about the mini computers, Explain about the MINI COMPUTER Minic...

Explain about the MINI COMPUTER Minicomputers are much smaller in size than mainframe computers and they are also less expensive.  The cost of these computers can differ from a

Logic-based expert systems - artificial intelligence, Logic-based Expert Sy...

Logic-based Expert Systems - Artificial intelligence: Expert systems are agents which are programmed to make decisions about real world situations. They are put together by uti

Implementing new technologies, There is a free internet access to all their...

There is a free internet access to all their customers they also ensure 24 hours security and for the post of chief information officer when the candidate has come for an interview

How does tcp achieve reliability, How does TCP achieve reliability? One...

How does TCP achieve reliability? One of the most significant technologies is retransmission. While TCP stands data the sender compensates for packet loss through implementing

How do subroutines help in program writing, How do subroutines help in prog...

How do subroutines help in program writing? Some of the significant characteristics of Subroutine that help in program writing are: A subroutine is named, each have a

QUELING SYTEM , SHOW THAT AVERAGE NUMBER OF UNIT IN A (M/M/1) QUELING SYTEM...

SHOW THAT AVERAGE NUMBER OF UNIT IN A (M/M/1) QUELING SYTEM IS EQUAL TO P/(1-p). NOTE:P=ROW

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

Illustrate the following list of consideration of Laptop, Illustrate the fo...

Illustrate the following list of consideration of laptop computers The following is a list for consideration: -  The processor must consume as little power as possible thus

What is code segment, Q. What is CODE SEGMENT? The logical program segm...

Q. What is CODE SEGMENT? The logical program segment is termed as code segment. When linker links a program it makes a note in header section of program's executable file defin

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