cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Matrix of scalar elements and Matrix returns {1,1}

sdarella
2-Guest

Matrix of scalar elements and Matrix returns {1,1}

Hi everyone,

 

I am experiencing two problems:

 

1. The classic "this value must be a matrix of scalar elements" when trying to multiply matrices. I have multiplied matrices which had complex elements before, so I am unsure why now the elements must be scalar.

Capture.PNG 

2. Every matrix element below shows as {1,1}. How to show the actual values of each element instead?

Capture2.PNG

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions

ad 1)

Mathcad is not complaining that the values are non-real. A non-real complex number is of course considered a scalar, too. But by using "submatrix" you created not scalars but 1x1 matrices. That seems to be the problem.

Use the vector/matrix indices to access the elements of a vector/matrix and use "submatrix" if you want to create a matrix consisting of part of another one.

So instead of writing "submatrix(zp_self,1,1,2,2)" simply use "zp_self[1,2". The shortcut "[" creates a matrix index.

For more help you would have to post the worksheet as its hard to debug a picture.

 

ad 2)

{1,1} represents a 1x1 matrix, not a scalar. The reason why  you had created that kind of structure is explained above. A matrix consisting of matrices is called nested matrix or nested array and there is an option to show them all. Assuming you are using real Mathcad 15 you either double click the resulting matrix or highlight it and chose "Format"-"Result" from the menu, go to the tab "Display Options" and  check "Expand nested arrays".

View solution in original post

2 REPLIES 2

ad 1)

Mathcad is not complaining that the values are non-real. A non-real complex number is of course considered a scalar, too. But by using "submatrix" you created not scalars but 1x1 matrices. That seems to be the problem.

Use the vector/matrix indices to access the elements of a vector/matrix and use "submatrix" if you want to create a matrix consisting of part of another one.

So instead of writing "submatrix(zp_self,1,1,2,2)" simply use "zp_self[1,2". The shortcut "[" creates a matrix index.

For more help you would have to post the worksheet as its hard to debug a picture.

 

ad 2)

{1,1} represents a 1x1 matrix, not a scalar. The reason why  you had created that kind of structure is explained above. A matrix consisting of matrices is called nested matrix or nested array and there is an option to show them all. Assuming you are using real Mathcad 15 you either double click the resulting matrix or highlight it and chose "Format"-"Result" from the menu, go to the tab "Display Options" and  check "Expand nested arrays".

LucMeekes
23-Emerald III
(To:sdarella)

2. Double-click the nested matrix and from the 'result format' pop-up menu, on the 'Display' tab, select "Expand nested matrix".

 

 

Success!
Luc

Top Tags