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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How To Multiply Each Cell Of The Array By Exponential Range Variables

fuatkabakcioglu
4-Participant

How To Multiply Each Cell Of The Array By Exponential Range Variables

Hi,

I have been trying to multiply each cell of the array by exponentially range variables.

To illustrate: first cell of the matrix should be multiply by 2, second row of the array should be multiply by 2^2, third row of the array should be multiply by 2^3 and so on... Below illustrated EL(GR) should have seen: First row;1.06, second row should have been 1.06^2, third row should have been 1,06^3 and so on. I would appreciated if you help me to sort this out... Regarding Mathcad sheet is also enclosed. 

fuatkabakcioglu_0-1588464391473.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

You are asking for something contradictory! First you write that you want to multiply the value by 1,2,2^2, etc but later you want to take them to the power of 1,2,3, etc. You have to decide what you are looking for!

Not sure, are you looking for one of the following two variants or for something completely different?

Werner_E_0-1588469657783.png

 

View solution in original post

7 REPLIES 7

You are asking for something contradictory! First you write that you want to multiply the value by 1,2,2^2, etc but later you want to take them to the power of 1,2,3, etc. You have to decide what you are looking for!

Not sure, are you looking for one of the following two variants or for something completely different?

Werner_E_0-1588469657783.png

 

First of all, thank you for your quick respond and this is much appreciated.

 

I am so sorry for the conrtadiction yes you are right. What I want to do is as you illustrated in the EL3(GR).

But now another issue has emerged. How am I supposed to multiply FE(l1) and EL(GR) element by element? When I do this as expected I am having just a scaler result. But what I am trying to have is, first row of the FE(l1) should be multiply with the first row of the EL(GR) and so on. The resultant array should be a matrix with the same row number of the multipliers.

 

Please find regarding mathcad sheet enclosed.

Thank you so much in advance

Best Regards

 

 

Use the vectorize operator. Select your multiplication and press [CTRL-_]  (That is: The Control key and the underscore key). That should result in an arrow above the multiplication, and tells Mathcad to multiply elements  of the vectors, element by element.

LucMeekes_0-1588520412062.png

 

Success!
Luc

Hi,

Thank you for the reply, but when I try to do your suggestion I am having below given warning.

fuatkabakcioglu_0-1588524753708.png

Can you please take a look shared mathcad sheet?

Best Regards

Fuat

The arguments of the multiplication must be vectors (of the same size).

Make sure your FE function returns a Vector, the same size as the EL function gives.

 

Success!
Luc

Hi,

 

Thank you for your quick respond and help. Whereas I have been trying to sort this out almost for 3 hours and I traced the error. The reason of the error is as I red boxed in the below given screenshot. It shows that the mistake is in the for loop but I dont know how to sort this out. I would really appreciated if you help me to solve this. 

 

Best Regards

Fuat

 

fuatkabakcioglu_0-1588547649090.png

 

Here is one possible way to do it

Werner_E_0-1588565251179.png

I have used the programming facility and local assignments but of course you may also use assignments on worksheet levels, especially if you need those vectors later anyway

Werner_E_2-1588565391709.png

 

 

Top Tags