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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Multiple two different vectors

YA_10963798
12-Amethyst

Multiple two different vectors

Hi everyone,

I want to use two different vectors in one equation ...what should be the iterator f ,q and dz 

 

YA_10963798_1-1729086370228.png

I used length function but it gives me strange results 

YA_10963798_2-1729086546971.png

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:YA_10963798)

Hope this is what you are looking for

Werner_E_1-1729102226055.png

 

 

View solution in original post

10 REPLIES 10
Werner_E
25-Diamond I
(To:YA_10963798)

Vectorization can only be used if all involved vectors/matrices are of the same dimension.

Its absolutely not clear to me what you expect as the result of this calculation. Maybe one single 3x1 vector??

A simple short example worksheet with a few corresponding demo vectors and the indication of the desired result would be very beneficial.
 
 

The problem is I'm  lost. myself . I don't know what's my question is ... hhhhhh I will try to solve it . Sorry for wasting your time 

Thanks anyway my friend

Werner_E
25-Diamond I
(To:YA_10963798)

You wrote that your second attempt gave you "strange results". So that means that you expected a different result - which one?

 

Do you see the f and q both of them have 3 matric ... The matrics in first raw (10X1) is actually the corresponding values of dz .. what I want to do is to multipy dz with the frist raw and then do the same in the second raw ... and the result of M should look like q >>> three matrices 

YA_10963798_0-1729100484841.png

YA_10963798_1-1729100898610.png

 

I will write demo worksheet and upload it right away

Werner_E
25-Diamond I
(To:YA_10963798)

So why not set up a small worksheet with a few vectors/variables of similar dimensions and post it, so we can show whats needed to do?

Its hard to explain just in words...

Try this

Werner_E_0-1729101737461.png

 

Sure .. See I have x and y both of them has 3 matrices I want to multiply z with first matrics of both of them like ( x*y*z)=(1*7*5) and then (2*5*8) in the first matrics raw  and  then does the same in the second matric so on... and j should look like x and y ..... the sheet is attached 

YA_10963798_0-1729101668772.png

 

Werner_E
25-Diamond I
(To:YA_10963798)

Hope this is what you are looking for

Werner_E_1-1729102226055.png

 

 

Perfect .... Thank you 

Werner_E
25-Diamond I
(To:YA_10963798)

Here is another way using an auxiliary function instead of the range k.

But its harder to read and to understand whats going on so I would prefer the variant using the range

Werner_E_0-1729103098280.png

 

And of course you could explicitly program the loops which are performed implicitly by the range and the vectorization

Werner_E_1-1729103401446.png

 

 

Nice .. thank you

Announcements

Top Tags