Skip to main content
10-Marble
June 22, 2022
Solved

Element by element division in matrix

  • June 22, 2022
  • 3 replies
  • 4067 views

Hi Team,
I know it is a long shot. But I hope there is a way to do this. Suppose I have 2 matrix with very different number of rows and columns, say A is M x N and B is L x K. How can I divide each element of A matrix with every element of B matrix and Have it in a form of Matrix.  I am trying few things with nested for loops but have had no luck yet.

Thanks in advance,

Kadhir

KAL_1625_0-1655941002524.png

 

Best answer by KAL_1625

I actually found a way to do what I need. But it shows matrix within a matrix with just number of rows and columns. How can I make it to display the entire matrix showing up with values. I have to display each matrix using index.

KAL_1625_0-1656001578280.png

 

3 replies

25-Diamond I
June 23, 2022

What data structure would you expect as a result? An M x N matrix where each element is an L x K matrix??

 

You may consider not only to show the two input matrices but, more important, the expected result! And then also attach the worksheet itself.

 

KAL_162510-MarbleAuthor
10-Marble
June 23, 2022

@Werner_E Yes I exactly expected what you are saying. A M x N matrix where each element is L x K matrix.

25-Diamond I
June 23, 2022

@KAL_1625 wrote:

@Werner_E Yes I exactly expected what you are saying. A M x N matrix where each element is L x K matrix.


Hmm!!?? But thats quite different from what you answered to ppal where you, too, said that this is exactly what you want the solution to look like!??

Anyway, here is a function which will create this huge result matrix:

Werner_E_0-1656006351080.png

 

With the matrices ppal used:

Werner_E_1-1656006386025.png

 

 

 

18-Opal
June 23, 2022

Like this???

ppal_0-1655952082041.png

 

ppal_2-1655952155948.png

 

KAL_162510-MarbleAuthor
10-Marble
June 23, 2022

This is exactly how I want my solution to look alike, but for some reason, my worksheet is showing error stating that the variable i and j should be scalar or matrix.

KAL_1625_0-1656000737809.png

 

KAL_162510-MarbleAuthorAnswer
10-Marble
June 23, 2022

I actually found a way to do what I need. But it shows matrix within a matrix with just number of rows and columns. How can I make it to display the entire matrix showing up with values. I have to display each matrix using index.

KAL_1625_0-1656001578280.png

 

21-Topaz II
June 23, 2022

Hi,

Is this what you intend?

Capture.JPG