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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Different constant for every column

ptc-1793698
7-Bedrock

Different constant for every column

Hello, help me with a stupid simple question.

I have a formula that I would like to calculate, but different matrixes of variables have a different number of rows.

There is one variable that has only one row while others have all 63. That means one variable is a constant for that single column.

Is there a simple way to avoid inserting subscrips for every variable?

KL

3 REPLIES 3

Kristjan,

I may have a solution, but see no way to attach it to this comment. Maybe that's impossible because you started this as a blog, rather than as a discussion.

Anyway. I'll try to explain:

In the expression for C.n, by using the vectorize operator, you've asked for the calculation to be performed for every matrix element. That requires that all matrices be the same size because matrix elements on corresponding locations are used/required to exist.

You can simply redefine C to be as high as e.g. matrix p with all rows filled as the one in C:

C:=<for> r <in> ORIGIN..ORIGIN+rows(p)-1

    R<column>r <- (C<transpose>)<column>ORIGIN

   <return> R<transpose>

If you put this between the definitions of C and C.n the error is gone.

The big question is: is this what the calculation requires?

i.e. that all values in a column of matrices p, Q and omega use the value in the first row of the corresponding column of C.

Success!

Luc

RichardJ
19-Tanzanite
(To:ptc-1793698)

I don't think you can attach files to comments on other peoples blogs.

Kristjan: If Luc's reply doesn't work for you please repost the question in one of the Mathcad discussion forums.

1. Simplfy the formula to make it visible

2. C is single to as an extra p , plug it at the very top of 'p'.

or any other of the constants

Another thing that does not work in this web community:

No font family in that compobox .

That compobox is of ridiculous small size !

Can't insert an image from file

jmG

Top Tags