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)

Estimate the natural frequency and damping factor, On the Moodle site just ...

On the Moodle site just below the assignment you will find data from a slow sine sweep test conducted on a car on a "four-post" road simulator for the frequency range 0 to 20 Hz in

Explain how someone refine the ratio analysis, Refining the Ratio Analysis ...

Refining the Ratio Analysis Basically, refinement leads to purity. Thus to get a cleaner, more understandable and consistent design need to iterate analysis process.  R

Explain disadvantage of optimal page replacement algorithm, Explain Disadva...

Explain Disadvantage of Optimal Page Replacement Algorithm Optimal page replacement algorithm cannot be implemented in the general purpose operating system as it is impossible

Commutatively of connectives - artificial intelligence, Commutatively of Co...

Commutatively of Connectives You will be aware from the fact that some arithmetic operators have a property that it does not matter which way around you give the operator input

Importance of using module-instance parameter, Using Module-Instance Parame...

Using Module-Instance Parameter: Parameter values can be overridden while a module is instantiated. New parameter values are passed at the time of module instantiation. Top-

Jsbjj, what are the output deice

what are the output deice

Explain processing of an interrupt, Q. Explain Processing of an Interrupt? ...

Q. Explain Processing of an Interrupt? The interrupt is processed as: Step 1: Number field in INT instruction is multiplied by 4 to get its entry in interrupt vector table.

Explain the methods of implementing interacting processes, Explain any two ...

Explain any two methods of implementing interacting processes. Two methods of implementing interacting process are given below: (i) Shared memory solution: In this scheme

How to convert binary to octal and hexadecimal, Q. How to convert Binary to...

Q. How to convert Binary to Octal and Hexadecimal? Rules for these conversions are simple. For converting binary to octal binary number is splitted in groups of three, that are

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