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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Converting a matrix m x m in a column m*m x 1

rdelascasas
6-Contributor

Converting a matrix m x m in a column m*m x 1

To all,

I need to transform a matrix with m rows and m columns in a column matrix where the matrix elements will be formed by the columns of the m x m matrix but in succesive order.

for example if the original matrix is 2 x 2, the new matrix will have 4 rows and 1 column with the two original columns in the 1 column of the new matrix.

Thank you in advance,

Rogelio

1 ACCEPTED SOLUTION

Accepted Solutions

Rogelio de las Casas wrote:

it did not work in my case.

Which method did not work?

But anyway, both should work, as a matrix of the dimensions you mention don't should be a problem for Mathcad in no way.

Mathcad give just the following sintaxis:

(the V at the end is just volts

Unfortunately we don't see anything. You can't paste a picture diretcly from the clipboard (wish we could) but you have to save it and the insert it using the appropriate button in this windows.

Even better is to attach you worksheet!! (Chose "advanced editor" at the upper right to do so).

We don't even know which version of Mathcad you are using.

One idea: If you play around with large matrices (but 250x 250 isn't that large) you may eventually end up with a not enough memory error because Mathcad has avery bad memory management and memory taken up by matrices is never freed. If this happens you have to close the program and restart it again.

Or are you using inline evaluations like V:=unravel(M)=..., assigning and evaluating in the same regions. There is kind of a bug and you may get an otherwise undefined "eng_exception" or "mpl_exception". Solution is to assign and evaluate/display in two separate regions (V:=unravel(M) and V=...).

View solution in original post

12 REPLIES 12

Thats pretty easy and I think the method goes back to a collection of utilities of Tom Gutman.

unravel.png

rdelascasas
6-Contributor
(To:Werner_E)

thank you very much, i will try and let you know.

thanks,

Rogelio

Here's an alternative approach.

M2Vec.PNG

Alan

Sorry Alan,

my response below was refering to the first answer. I will try your approach now.

it looks like my response shown up after yours.

regards, and thanks,

rogelio

it did not work in my case.

it looks like Mathcad 15 cannot process big matrices, in my case of 250 elements and square.

it did ok until 24 rows and columns square matrix.

Beginning with 25 rows and columns square matrix, Mathcad give just the following sintaxis:

(the V at the end is just volts

thanks,

Rogelio

Rogelio de las Casas wrote:

it did not work in my case.

it looks like Mathcad 15 cannot process big matrices, in my case of 250 elements and square.

it did ok until 24 rows and columns square matrix.

Beginning with 25 rows and columns square matrix, Mathcad give just the following sintaxis:

(the V at the end is just volts

thanks,

Rogelio

Mathcad 15 doesn't have a problem with matrices of this size - see below (random entries in the matrix).

M2Vec2.PNG

Upload the file that gave the error message so we can try to identify the problem.

Alan

You are right!!

i moved the part of the calculation related only to put the matrix in a column matrix to a new mathcad blank sheet and it worked!!! with 250 square matrix.


But it did not work in my original mathcad file.

The original file is extensive, i will need to find where the problem is.

regards,

Rogelio

Rogelio de las Casas wrote:

it did not work in my case.

Which method did not work?

But anyway, both should work, as a matrix of the dimensions you mention don't should be a problem for Mathcad in no way.

Mathcad give just the following sintaxis:

(the V at the end is just volts

Unfortunately we don't see anything. You can't paste a picture diretcly from the clipboard (wish we could) but you have to save it and the insert it using the appropriate button in this windows.

Even better is to attach you worksheet!! (Chose "advanced editor" at the upper right to do so).

We don't even know which version of Mathcad you are using.

One idea: If you play around with large matrices (but 250x 250 isn't that large) you may eventually end up with a not enough memory error because Mathcad has avery bad memory management and memory taken up by matrices is never freed. If this happens you have to close the program and restart it again.

Or are you using inline evaluations like V:=unravel(M)=..., assigning and evaluating in the same regions. There is kind of a bug and you may get an otherwise undefined "eng_exception" or "mpl_exception". Solution is to assign and evaluate/display in two separate regions (V:=unravel(M) and V=...).

rdelascasas
6-Contributor
(To:Werner_E)

Werner,

Here is the matrix that i am working on. It really worked using the method that you shared.

it is not working in my original file, it might be something with variable definitions, or something else.

Regards,

Rogelio

it is not working in my original file, it might be something with variable definitions, or something else.

Rather something else 😉 See my post below - I guess its the default setting of the display options as described.

To set the default for the worksheet click to an empty space , then go to them menu and chose Format / Result / Display Options / Matrix Display Style. I may be a good idea to set it back to automatic. You can still change that style individually for each expression.

I think I got it! You see something like M = BigMatrix{250,250}V, right? Mathcad can display matrices as matrix or as table. Default is "automatic" and Mathcad will switch to a scrollable table if the dimensions excel a certain limit. You can change this in the "Result Format" box. If you change here that you want Mathcad to show the full matrix as matrix, Mathcad shows you that Bigmatrix if the matrix has more than 600 elements.

I guess tgis is what you are experiencing. So go to the Result Format menu and change Display Options accordingly.

rdelascasas
6-Contributor
(To:Werner_E)

Yes!!!

Werner,

you were right!!

i change the result format from matrix to automatic, and it did it perfectly well in my own original file.

thanks.

Best regards,

Rogelio

Top Tags