Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Design Statement: Write a MATLAB script that will demonstrate the differences be

ID: 3746438 • Letter: D

Question

Design Statement: Write a MATLAB script that will demonstrate the differences between matrix and array addition and multiplication. 8. Write the pseudocode OR create a flowchart for the entire script BEFORE starting to program. 9. The script must adhere to the following guidelines: a. Be fully commented, including a comment block at the end of the code that includes the pseudocode that you wrote before starting to write the program. b. Allow the user to input the dimension for square matrices to be used throughout the remainder of the program. The value for the dimension must be greater than 3 and less than or equal to 25. (This value will be referred to as n for the remainder of the Design Statement.) c. Generate the following n x n arrays i. primeMat: An array of sequential prime numbers (Hint: Use the lookfor command.) ii. randMat: An array of random integers between n and 10n d. Demonstrate that matrix and array addition are identical by adding primeMat and randMat and.. i. Outputting the first 3 rows and 4 columns of the resulting matrix for each operation. ii. Outputting the average and total value of all elements in the resulting matrix for each operation e. Demonstrate that matrix and array multiplication are different by multiplying primeMat and i. Outputting the first 3 rows and 4 columns of the resulting matrix for each operation. i. Outputting the average and total value of all elements in the resulting matrix for each randMat and... operation

Explanation / Answer

MATLAB has two distinct sorts of number-crunching activities: exhibit tasks and lattice tasks. You can utilize these math activities to perform numeric calculations, for instance, including two numbers, raising the components of an exhibit to a given power, or duplicating two frameworks.

Grid activities take after the principles of straight variable based math. By differentiate, exhibit tasks execute component by component activities and bolster multidimensional clusters. The period character (.) recognizes the exhibit tasks from the lattice activities. In any case, since the framework and exhibit tasks are the same for expansion and subtraction, the character sets .+ and .- are superfluous.

Cluster Operations

Cluster tasks execute component by component activities on comparing components of vectors, grids, and multidimensional exhibits. On the off chance that the operands have a similar size, at that point every component in the principal operand gets coordinated with the component in a similar area in the second operand. In the event that the operands have perfect sizes, at that point each info is certainly extended as expected to coordinate the measure of the other. For more data, see Compatible Array Sizes for Basic Operations.

As a basic case, you can include two vectors with a similar size.

In the event that one operand is a scalar and the other isn't, at that point MATLAB verifiably grows the scalar to be indistinguishable size from the other operand. For instance, you can figure the component savvy result of a scalar and a lattice.

Understood extension additionally works on the off chance that you subtract a 1-by-3 vector from a 3-by-3 grid in light of the fact that the two sizes are perfect. When you play out the subtraction, the vector is certainly extended to end up a 3-by-3 lattice.

A line vector and a segment vector have perfect sizes. On the off chance that you include a 1-by-3 vector to a 2-by-1 vector, at that point every vector verifiably ventures into a 2-by-3 network before MATLAB executes the component shrewd expansion.

Network Operations

Network tasks take after the guidelines of direct variable based math and are not perfect with multidimensional exhibits. The required size and state of the contributions to connection to each other relies upon the task. For nonscalar inputs, the network administrators by and large compute unexpected answers in comparison to their cluster administrator partners.

For instance, on the off chance that you utilize the framework right division administrator,/, to partition two lattices, the networks must have a similar number of segments. In any case, on the off chance that you utilize the grid augmentation administrator, *, to duplicate two lattices, at that point the networks must have a typical internal measurement. That is, the quantity of segments in the primary information must be equivalent to the quantity of lines in the second info.