How to get an input matrix from user?

  • Context: Undergrad 
  • Thread starter Thread starter goofy
  • Start date Start date
  • Tags Tags
    Input Matrix
Click For Summary
SUMMARY

This discussion focuses on implementing matrix multiplication in MATLAB without using the built-in multiplication command. The program must prompt users for dimensions l, m, and n, ensuring they are positive integers and that multiplication is feasible. Users are also required to input the values for two matrices A and B, after which the program calculates and displays the resultant matrix M. Key requirements include input validation and proper output formatting without semicolons.

PREREQUISITES
  • Understanding of MATLAB programming syntax
  • Basic knowledge of matrix operations
  • Experience with user input handling in MATLAB
  • Familiarity with conditional statements for input validation
NEXT STEPS
  • Learn how to implement user input validation in MATLAB
  • Research matrix operations in MATLAB, focusing on manual multiplication techniques
  • Explore MATLAB's array manipulation functions for matrix handling
  • Study error handling in MATLAB to manage invalid inputs effectively
USEFUL FOR

This discussion is beneficial for MATLAB programmers, students learning linear algebra, and anyone interested in manual matrix operations without relying on built-in functions.

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

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 17 ·
Replies
17
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K