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

Code in Matlab please Write a program that will ask the user to enter the dimens

ID: 669812 • Letter: C

Question

Code in Matlab please

Write a program that will ask the user to enter the dimension of square matrices he/she wants to enter (let’s call it N). Then enter two matrices (let’s call them A and B), each of dimensions N by N (suggestion – don’t make N too big). Then, in your program, please calculate a new matrix (let’s call it C), which will be the sum of the two matrices you entered (i.e. C=A+B). Display the result matrix (matrix C) by just calling it in the program (i.e. by just typing C, without the semicolon behind it).

Explanation / Answer

#include #define DIM 3 int printmat(float a[DIM][DIM] ); int main() { int i, j, k; float a[DIM][DIM] = { {-5.1, 3.8, 4.2}, { 9.7, 1.3, -1.3}, {-8.0, -7.3, 2.2} }; float b[DIM][DIM] = { { 9.4, -6.2, 0.5}, {-5.1, 3.3, -2.2}, {-1.1, -1.8, 3.0} }; float c[DIM][DIM]; for (i=0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote