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 in detail about real time processing, Explain in detail about Real ...

Explain in detail about Real time (transaction) processing When booking seats on a flight, for illustration, real time (transaction) processing would be used. Response to a que

Spirit duplicating of information, Spirit Duplicating Equipment Requir...

Spirit Duplicating Equipment Required Spirit Duplicator (also known as hectograph) Thermal copier (optional) Materials Masters Hectographic carbon COPY pa

The advantage of using a database management system, The advantage of using...

The advantage of using a Database Management System The advantage of using a Database Management System for a data store is that databases have mechanisms for describing data,

The 2''s complement of the decimal number, What is the 2's complement of th...

What is the 2's complement of the number 1101101 ? Ans. 0010011 is the 2's complement of the number 1101101. As 1's complement of the number 1101101 is 0010010 and 2's comple

Describe the concept of value creation, I am required to write about the im...

I am required to write about the impact of the internet on firms with reference to the following questions: 1. Describe the concept of value creation. Explain how a firm can use

Physics, #questionabut diffraction ..

#questionabut diffraction ..

Double negation, Double Negation : All parents are forever correcting ...

Double Negation : All parents are forever correcting their children for the find of double negatives,  there we have to be very alert with them in natural language like: "He d

Career after BSc CS, Sir,wish to receive guidance from you how to join in A...

Sir,wish to receive guidance from you how to join in Aeronautical Engineering after Bsc Computer Science. I am a Girl.Interested to work in AE field, it will be better to use in co

What is memory controller, What is memory controller? A memory controll...

What is memory controller? A memory controller is a circuit which is interposed among the processor and the dynamic memory. It is used for performing multiplexing of address bi

Effective branching rate - heuristic searches, Effective Branching Rate: ...

Effective Branching Rate: Assessing heuristic functions is an important part of "AI" research: a particular heuristic function may sound such a good idea, but in practice give

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