Filling an n4 x n4 Matrix with a 4 x 4 Matrix

  • Context: MATLAB 
  • Thread starter Thread starter ziad1985
  • Start date Start date
  • Tags Tags
    Matrix
Click For Summary
SUMMARY

The discussion focuses on filling an n4 x n4 matrix using a 4 x 4 matrix in programming. The user seeks a method to replicate the smaller matrix, specifically when n equals 4, resulting in a 16 x 16 matrix. The recommended approach is to utilize the MATLAB function repmat(), which efficiently replicates arrays. Users are advised to type help repmat in the MATLAB command prompt for detailed instructions on its usage.

PREREQUISITES
  • Understanding of matrix operations in MATLAB
  • Familiarity with MATLAB syntax and functions
  • Basic knowledge of array manipulation
  • Concept of matrix dimensions and replication
NEXT STEPS
  • Research the repmat() function in MATLAB for array replication
  • Explore other MATLAB functions for matrix manipulation, such as reshape()
  • Learn about nested loops in MATLAB for custom matrix filling
  • Investigate performance implications of different matrix filling methods
USEFUL FOR

This discussion is beneficial for MATLAB users, data analysts, and anyone involved in numerical computing who needs to efficiently manipulate and replicate matrices.

ziad1985
Messages
244
Reaction score
0
I have a [4 X 4] matrix , and another one which is [n4 X n4] n is an integer.
my question is there a way to fill the [n4 X n4] with n times the small [4 X 4] one.
meaning if the [4 X 4] is a
what i want to do is
a a a a
a a a a
a a a a
a a a a
n is 4 , so it's [16 X 16]
any certain function to use ? or it would have to be a For Loops to use ?
 
Physics news on Phys.org
I think repmat() is what you need. Type help repmat at the prompt for instructions on the use.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
4K