#### Matrix operations

```Hello

I would like to apply a formula operating on matrices/vectors to a
number of rows.

Formula:
T1*(v1+T2*v2)

Input:
T1 is a 2x2 Matrix, v1 a 2x1 vector, both are defined through cells
which are always at the same location within the Worksheet. For example
T1 in A1:B2, v1 in A3:B3.
T2 is a 2x2 Matrix defined by { cos(x),sin(x); -sin(x),cos(x)}.
x is a value, v2 a 2x1 vector. See below how they are defined

Output:
A 2x1 vector

I now want to apply the formula to a number of rows. In each row the
column 1 to 2 define v2, column 3 defines x. The result of the formula
should be in column 4 and 5.

How would you do that? Thank you for your help

Florian Kaufmann

Its not that I want you to do my work without trying myself first.
That's what I tried so far

My first try:
---------------
I gave the name T1 to the range A1:B2, v1 to A3:B3.
In A4:B4 is v2, in C4 is x.

In C5 I put
=INDEX( MMULT( T1 ; v1 + MMULT( {cos(C4),sin(C4); -sin(C4),cos(C4)};
A4:B4 ) ) ; 1 )

In C6 I put
=INDEX( MMULT( T1 ; v1 + MMULT( {cos(C4),sin(C4); -sin(C4),cos(C4)};
A4:B4 ) ) ; 2 )

However, it turns out that a construct like {cos(C4),sin(C4);
-sin(C4),cos(C4)} is not possible, since arrays of type {...} must be
constant. They can not contain references to cells as I did with C4.

Second try:
------------
I tried to write a VB Function which does the job. But since I am an
absolute beginner in VB, I have various troubles.
- How to call my function from a cell. I always get "#Name?"
- How to define T2 within the function
- There seems to be a different between Ranges and Arrays, and I don't
know where it is. I get errors passing ranges to mmult.

```
 0
sensorflo (5)
3/2/2006 6:27:01 PM
excel 39879 articles. 2 followers.

3 Replies
421 Views

Similar Articles

[PageSpeed] 51

```I have to add that in fact the formula is more complex and the
vectors/matrices have higher dimensions. That's why I want to do it
with matrix/vector operations. That is instead of
INDEX(MMULT(A1:B2;A3:A4);1) I don't want to write A1*A3+B1*A4.

```
 0
sensorflo (5)
3/2/2006 6:37:44 PM
```Array T2 must exist as a range of cells.
Below are two approaches.

=====================

T1 is B1:C2
v1 is B4:B5
v2 is B7:B8
T2 is B12:C13
y  is B15:B16

insert your numerical values into T1,V1,V2,T2

into cell B15 insert =MMULT(B1:C2,B4:B5+MMULT(B12:C13,B7:B8))
drag/copy B15 into B16
select B15:B16
type cntrl-shift-enter

Using Named Ranges
==================

name B1:C2     as  matT1
name B4:B5     as  matV1
name B7:B8     as  matV2
name B12:C13  as  matT2

into cell B15 insert =MMULT(matT1,matV1+MMULT(matT2,matV2))
drag/copy B15 into B16
select B15:B16
type cntrl-shift-enter

dave y.

```
 0
delfiled (5)
3/2/2006 7:29:13 PM
```The problem with this approach however is that I don't have the place
for the extra cells that T2 needs. I very much liked to calculate T2
within the formula.

Maybe I have to say what this is all about. The sheet converts
coordinates between different coordinate systems. Look at the 'excel
sheet' below

A       B       C       D       E       F      G
1   T1:     1       0
2           0       1
3   V1:     1
4           1
5
8   |-sys1 -----------------|-sys2------------------
9   x       y       t       x       y       t
10  |-----------------------|-----------------------
11  0       0       0       =f12x() =f12y() =f12t()
12  0       1       1       =f12x() =f12y() =f12t()
.........
20  =f21x() =f21y() =f21t() 0       0       0
21  =f21x() =f21y() =f21t() 0       1       1

The first part contains the parameters of the Transformation. That
would be T1 = B1:C2, V1 = B3:B4. The rest is a list of coordinates. In
each row coordinates are given in one system and calculated in the
other one. v1 would now be the 2 cells in the x y column, x (as in my
first posting) would be the t column. Note that the x in this posting
is not the x in the first posting - sorry for the confusion.

The formulas f12x() etc only symbolise the actual formulas and shows
which cells contain the same formulas. An actual example would be (for
D11):
=INDEX( MMULT( \$B\$1:\$C\$2 ; \$B\$3:\$B\$4 + MMULT( {cos(C11),sin(C11);
-sin(C11),cos(C11)}; A11:B11 ) ) ; 1 )

However, as said in my first posting, this is not possible.

As said the purpose is to transform any coordinates between the
systems. That is it is not known in advance which row converts from
which system into which. The user fills in values for the coordinates
of one system and then copies the required formulas into the other
columns of the same row. So he gets his custom list of coordinates.

Now one can see that I don't have space to put T2 into any cells. Each
Row would need a 2*2 cell block as temporary storage for T2.

Again, this is simplified. Actually I have 3 systems, each has 4
dimensions, and there are about 4 Matrices and 4 Vectors being the
parameters of the transformation.

Greetings

Florian Kaufmann

```
 0
sensorflo (5)
3/2/2006 9:16:30 PM

Similar Artilces:

Starting today, whenever I click on a link in an e-mail message, the following box pops up: This operation has been canceled due to restrictions in effect on the computer. Please contact your system administrator. Does anyone know why this is happening, and what I can do to fix it so that I can click on links? -- Brett See if the articles at http://support.microsoft.com/?kbid=310049 and http://support.microsoft.com/?kbid=307818 help with this. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers ...

receiving Msg "Can't install custom operations"
When a user with Outlook 2003 receives a email from Outlook 2000 with voting buttons and a JPG file embeded in the email they receive the message "Can't install custom operations". Any ideas on what is causing this. Thanks Art ...

matrix or lot matrix
I recently integrated RMS at my liquor store. It was suggested that I use a Matrix type for the items such as beer that are sold different ways but use the same UPC code. For instance, six packs and singles have one UPC code and are therefore a Matrix because of the different QTY and Price. The 24 pack case is sold warm and cold and therefore is a matrix because it has the same UPC but sold at a different price depending on the TEMP. The six packs and singles are children of the warm 24 pack as this is how they are made and how the original product is received. I've read in some other...

Cannot open hyperlinks in outlook 2007
I've found many posts saying the answer is to set IE as your default application for opening http:, https:, url, etc, but as I use Firefox I don't see why setting this browser as the default for all of these extensions and protocols as the default, from the control panel while running it as Administrator, does not work. Any suggestions? You receive an error message when you click a hyperlink in Outlook: http://support.microsoft.com/kb/310049/en-us -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. How to ask a question: http://support.mi...

Fast alternative to table based state transition matrix
I got this answer from comp.theory. It was completely obvious once it was explained. It is trivially simple to create a DFA based recognizer without a state transition matrix data table. Simply encode case statements corresponding to inputs within the case elements of a case statement corresponding to states. In at least some cases the (case within case) method might be faster depending upon whether or not memory is reduced enough to more than offset the higher case statement overhead to increase cache locality of reference. "Peter Olcott" <NoSpam@OCR4Screen.com...

Matrix
I have a matrix, lets say 10 down and 10 across. I want to be able to type lets say one through 10 in one cell from the column, and then one through 10 in another cell from the across column, and I want the 3rd cell to give me the intersection of those two cells.. So for example, the matrix looks like this.. 1 2 3 1 5 10 5 2 7 8 9 3 4 3 2 and when I type 2 in the first cell and 3 in the next cell I want the result to be 9! Thank you all for helping me.. Eyad With your example data list in A1:D4, And you type the 2 in E1, And you type the 3 in E2, Try this:...

Operation failed. An object could not be found
I am presently using outlook express only because my outlook stopped working. Express works fine, but in Outlook, everytime I try to send any type of email I get the error message: "The operation failed. An object could not be found." It is Outlook 2002, w/SP-2 installed I've tried reinstalling the program but with no effect. Any ideas? Can you give more information on the actual error? What object? -- Nikki Peterson [MVP - Outlook] "Bill Thaden" <wathaden@writeme.com> wrote in message news:8f6001c34599\$0f976a00\$a401280a@phx.gbl... I am presently using o...

Multiple Operating Systems
Hi All I've recently published a workbook containing vba code to several users who have different version of both Excel and Windows, both minimum stanards are Excel 2000 and Windows 2000/NT, yet the application runs perfectly on some but not others. The machines that have the problems have the problems at differing stages too?? I have the workbook, which I created with XP sp2 and Excel 2000, password protected to prevent users from tampering with the code. Any suggestions anyone please?? Wardy Where does the problem occur? The code? -- HTH Bob (there's no email, no snail mail...

Illegal Operation #7
When I start up Outlook 2000 I get a message that I have performed an illegal operation. Have "fixed" outlook from the install disk and have reloaded windows...but I keep getting the message. When I close the error message, Outlook also closes. What's up! ...

oe express 6, restoring backed up folders gives "illegal operation"
Friends, I know this board is not for Outlook Express, but I don't see an OE board, and am hoping an expert can help me through a major problem. Just came back from overseas. Before I left, worrying about house being burglarized and computer stolen, I copied the email folder (that I'd astutely named EMAIL) to a CD-R, and then deleted the folder. It had many files, most with a .dbx extension, that were clearly the emails I'd received and sent over the years. In regular Outlook (at work), I've backed up my emails or transferred them to another computer by copying the .p...

Outlook 2002 "The operation Failed" when clicking Send/Receive
I have Outlook 2002, when I click SEND/RECEIVE, I get the error message "The Operation Failed". No error numbers are listed, that is the exact and complete message. I have looked on the Microsoft website and nothing there was helpful. I tried deleting the email account and adding it, I also uninstalled Outlook and reinstalled it. I can 'Test' my account settings and it passes, but I never receive the test email. I can compose an email and click 'Send' and that works fine. It is not an ISP problem as Outlook Express works fine. So I can send email, but ca...

sorting matrix data
I have a matrix that returns the volume by month of certain items. The months represent the colum data. How do I sort the data that appears in month column "today's month -7"? Please help. See if that helps you http://msdn.microsoft.com/en-us/library/cc627509.aspx "dataGirl" <dataGirl@discussions.microsoft.com> wrote in message news:548C4B6F-84C1-4114-8B29-79B8C53837B1@microsoft.com... >I have a matrix that returns the volume by month of certain items. The > months represent the colum data. How do I sort the data that appears in >...

matrix
Hi! Is there any way to create larger than 3x3 matrices in vc++.net. The built in Matrix class creates only 3x3. Thanks in advance Regards Hi > Is there any way to create larger than 3x3 matrices in vc++.net. The built > in Matrix class creates only 3x3. i think you should create your own class for such purpose. i.e, you can create martix of matrixes: each element of such matrix should be matrix too. maybe it will help you. Regards, Robert ...

Like Operator with Wildcard
I'm using SQL2008. I'm searching postal addresses ,which I realize is a rather difficult and obtuse task, but anyway... Is there a way to search in TSQL using the "Like" operator that includes a wildcard, in my case, a period? For instance, I'm searching for all addresses that end in "Ave" (for Avenue). But I'm running into issues like the following: Syntax: Like '%ave%' Returns: "111 Smith Ave"; "111 Smith Ave." (But it also undesirably returns "111 Avenida Playa") Syntax: Like '% ave %...

Publisher cannot complete the operation
When trying to use the Wizard to create a publication I get the message, "Publisher cannot complete the operation." Is this RAM related? ...

Matrix / Lot Matrix items
I have a few questions around a Matrx item and where to use them. Are matrix items specifically for categorization in the Store Administrator or do they reap some benefit in the POS (front end) itself as well? I am trying to determine their usage beyond categorization and configuration. Any assistance would be greatly appreciated This is a multi-part message in MIME format. ------=_NextPart_000_1261_01C723CC.062E32E0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mhodgdon, It gives you a list of options to select the proper item. Sel...

Outlook 2002 Send and Receive Operation Failed
I have OL2002, and when I press send/receive, I get the message "operation failed" and all I can to is close the little popup window. There is no other error message. Please help. What types of accounts do you have installed? If you Test Account Settings, what is the report on the errors tab? Does your ISP require that you authenticate before sending? If you remove and reinstall your mail account(s), does the message still appear? What Microsoft Knowledge Base Articles have you already researched and tried? --� Milly Staples [MVP - Outlook] Post all replies to the group to ...

Error message "The operation failed"
Hi, we have a public contacts folder with a self designed form. This form includes a field called "Add. Notes". Since a few days, I cannot acces this field anymore when I try to create a view with this field, or when I try to drag and drop this field from the field chooser to the column title. I always get the error "The operation failed" - but this isn't really helpful :-( I've deleted the formscache already, no success. When I open an item with this field associated, it works perfectly in the form itself, only when I try to access the field from the preview pane i...

How do I find the determinant to a 3x8 matrix in Excel?
I'm trying to figure this out for school and am trying to avoid using the Solver tool. In Help search for <matrix> Why would you even think of Solver for this? Please tell us what mark we get for your homework. -- Bernard Liengme www.stfx.ca/people/bliengme remove CAPS in email address "AL" <AL@discussions.microsoft.com> wrote in message news:0945D8B7-74B8-4B1E-B09A-140DDA6B583C@microsoft.com... > I'm trying to figure this out for school and am trying to avoid using the > Solver tool. Doesn't the matrix need to be square? -- Cordially, Chip...

Help With Worksheet Operations
Is there any way in vba code to reproduce the same functionality in Excel as pressing Ctrl+right and/or Ctrl+down? I need a quick way to move to the last column and the last row on a spreadsheet. Also, is there a quick way to convert the worksheet to a string array or anything else (maybe a dataset)? Try Some Like this Sub MovetoEndDown() Range("A1").End(xlDown).Activate '(xlToRight) in case you want to move to the right. End Sub or Sub MoveDownPlus1Row() Dim NextRow As Variant NextRow = Range("A20000").End(xlUp).Row + 1 Cells(NextRow, 1).Activate End Sub Hope thi...

I can't close folder (pst file). message "The operation failed. A.
When using microsoft outlook 2003. After open my pst file and want to close after that. I can't close folder (pst file). message box "The operation failed. An object coulnot be found." Our IT engineer cannot solve this problem and told me this is one of "microsoft bugs". How can i fix this problem. thanks and regards Aryo <Aryo@discussions.microsoft.com> wrote: > When using microsoft outlook 2003. > After open my pst file and want to close after that. > I can't close folder (pst file). message box "The operation failed. An > object couln...

Operation failed #7
Operation Failed message when Send/Receive is selected. Tried "Test Account Settings ..." got me online. I can send e-mail, but not Receive ...

Matrix Input
I have an 8x8 matrix and I want to enter values into the matrix. So I would like to enter the values by Row, so that I don't have to input 64 times. The inputs are variables. So the first Row would be Matrix(Row = 1, ) = 1, x*5, X^3, 1, 8, .... Is there a way to do this? Thanks ...

Word 2004 Data Merge with Nested If-THEN-ELSE and arithmetic/logic operations
I have a fairly complex data merge document I've been using for years with Word 98 and Word 2001. I recently upgraded to Word 2004, for OS-X, mainly because Office 2001 crashed whenever I tried to cut&paste. The new Word 2004 hangs when it tries to read the Word 2001 merge template. So, I tried to recreate it in Word 2004, and find that - I can't see the merge commands that I've inserted; there seems to be no menu item that makes them viewable (though you can make the results of the merge viewable - I want the raw commands) - I can't nest If-Then_Else inside another If-T...

INVALID OPERATION 425?
I HAVE AN EPSON TM-T88IIIP POS PRINTER AND WHEN I TRY TO PRINT A RECEIPT I GET INVALID OPERATION 425 THE PRINTER CANNOT BE ACCESSED IT MAY BE LOCKED BY ANOTHER APPLICATION? Do you have it set to share the OPOS in SO Mgr config? This is under SO Mgr> File> Config> Options> POS Options> 'Share the OPOS printer with other applications'. -- Jocelyn "WPALMER72" wrote: > I HAVE AN EPSON TM-T88IIIP POS PRINTER AND WHEN I TRY TO PRINT A RECEIPT I > GET INVALID OPERATION 425 THE PRINTER CANNOT BE ACCESSED IT MAY BE LOCKED > BY ANOTHER APPLICATION...