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

What is glitch and what are causes of it, What is glitch? What causes this ...

What is glitch? What causes this (describe with waveform)? How to overcome this? The gated clock‘s corresponding timing diagram demonstrates that it implementation can lead to

What you mean by organizational effectiveness, Q. What you mean by organiza...

Q. What you mean by organizational effectiveness? Organizational effectiveness is measured in terms of productivity, structural flexibility, Employee involvement and Job satisf

Define dynamic linking, Define dynamic linking.  Dynamic linking is sam...

Define dynamic linking.  Dynamic linking is same to dynamic loading, rather that loading being postponed unless execution time, linking is postponed. This feature is usually us

What are the factors determine the control signals, What are the factors de...

What are the factors determine the control signals? Contents of the control step counter Contents of the instruction register Contents of the condition code flag

Enumerate the history of computers, Enumerate the History of computers ...

Enumerate the History of computers Basic information about technological development trends in computer in past and its projections in future. If you want to know about compute

Entrepreneurship, explain succession planning and strategies for harvesting...

explain succession planning and strategies for harvesting and ending the venture

Rational number expression evaluator, Develop a RPN rational number express...

Develop a RPN rational number expression evaluator (REEval). The learning objectives are: improved procedural programming skills improved confidence in designing and

Self knowledge - characteristics of an experts system, An experts system ...

An experts system has knowledge that lets it reason about its own operations plus a structure that simplifies this reasoning process. For example if an expert system

Explain crossbar exchange with all call processing steps, Explain crossbar ...

Explain crossbar exchange, with all call processing steps and diagrams. The fundamental idea of crossbar switching is to give a matrix of n x m sets of contacts with only n + m

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