How to get an input matrix from user?

  • Thread starter Thread starter goofy
  • Start date Start date
  • Tags Tags
    Input Matrix
Click For Summary
To create a program for matrix multiplication without using MATLAB's multiplication command, the program must first prompt the user for positive integer dimensions l, m, and n, ensuring that the dimensions allow for valid multiplication. It should then request the user to input the values for the two matrices A and B based on the specified dimensions. After validating the inputs, the program will perform the matrix multiplication M = A * B manually and calculate the resulting matrix M. Finally, the program will display the resultant matrix M without using a semicolon to suppress output. This approach ensures user engagement and proper validation throughout the process.
goofy
Messages
2
Reaction score
0
how to get an input matrix from user?

WITHOUT using the MATLAB ‘MULTIPLICATION COMMAND’ write down your own program to implement the matrix multiplication M = A*B, where A and B are two constant matrices of dimensions l x m and m x n, respectively. The program should:
 Prompt the user to enter the dimensions l, m and n;
 Check if all the dimensions are positive integers and if this is not the case, ask the user to enter the values again; also to check whether multiplication is possible or not according the entered dimensions
 Prompt the user to enter the values of the two matrices;
 Apply matrix multiplication M = A * B and calculate the product M;
 Display the resultant matrix M [don’t use ‘;’ at end of statement in order to display].

PLZ help i m get stuck...
 
Physics news on Phys.org
Thread 'How to define a vector field?'
Hello! In one book I saw that function ##V## of 3 variables ##V_x, V_y, V_z## (vector field in 3D) can be decomposed in a Taylor series without higher-order terms (partial derivative of second power and higher) at point ##(0,0,0)## such way: I think so: higher-order terms can be neglected because partial derivative of second power and higher are equal to 0. Is this true? And how to define vector field correctly for this case? (In the book I found nothing and my attempt was wrong...

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 17 ·
Replies
17
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
27
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
2
Views
2K
  • · Replies 26 ·
Replies
26
Views
834