The following warnings occurred:
Warning [2] Undefined array key 87015 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87016 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87050 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87062 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87076 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87107 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87140 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87147 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87016 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87062 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 87147 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





HP-49G Vector-Matirx Multiplication



#4

Can someone please tell me why my HP-49G will not multiply a vector [nx1] times a matrix [nxn], but it will multiply a matrix [nxn] times a vector [nx1]? Vector-matrix multiplication is a perfectly valid mathematical operation, but the HP-49G gives me an "Invalid Dimension" error. I know that I can overcome this error by placing the vector in the last row of an [nxn] matrix, but I perform this operation many times for my some of my engineering courses and this process becomes cumbersome, especially during an exam.


#5

William,

you need a "horizontal" vector on the left side of a matrix. To create it, just enclose a vector in another pair of brackets.

2:[ [ 1 2 3 ] ]
1:[ [ 1 0 0 ]
[ 0 1 0 ]
[ 0 0 1 ] ]
This multiplies fine.

Marcus

Edited: 8 Feb 2006, 11:01 a.m.

#6

When you multiple a vector and a matrix you are really multiplying a row/column matrix with a matrix. Therefore the rule regarding the matrices' dimensions must be obayed.

Namir


#7

You can only multiply matrices A and B if the number columns of A is the same as the number of rows of B.

Consider C=AxB then if A is MxN and B is NxP then resultant matrix C is MxP.

Cij=sum(Aik*Bkj) where k = 1 to N

#8

William --

As others explained previously, the result of matrix multiplication A*B includes the set of all dot products of the rows of A with the columns of B. The matrices must be dimensioned accoringly: the number of columns of A must equal the number of rows of B. A column vector is a matrix with only one column; a row vector is a matrix with only one row.

Also: In general, matrix multiplication is not commutative, even if both orders of multiplication are defined under the rules.

If one wants to left-multiply a column vector by a matrix, the column vector must usually be transposed as a row vector. The result will be dimensioned as a row vector.

There is a built-in function ATB on the HP-15C for that purpose. In Matlab, it would be A'*B.

A useful theorem: (A*B)T = BT*AT

Regards,

-- KS


#9

Thank you all for your input. I may not have made my problem clear in my previous message. So, I will try again. This is what I am doing.

[1 2 3] <sto> A (1 row x 3 columns)

[[1 2 3]
[1 2 3]
[1 2 3]] <sto> B (3 rows x 3 columns)

The number of columns in A i equal to the number of rows in B. I am defining these matrices via MTRW. The operation AxB should yield...[6 12 18]...however, my HP-49G says..."Invalid Dimension". The calculator will calculate BxA = [14 14 14]; THIS operation should give me an error message. Isn't this the opposite of what I should be getting? Do I have some obscure flag un-checked?

Thank you,
William


#10

William --

You're in luck -- I also happen to have an HP-49G, so was able to try your example. (I should point out that in RPL, it's {data} 'A' STO, not {data} STO 'A'...)

I follow the example -- it looks to me like a row-vector A and a square matrix B. The vector entered with a single set of brackets on one line even looks like a row vector in the Matrix Editor.

But, when multiplying them with 'A' above 'B' in the stack, I get the same dimension error. Marcus von Cube's post has the fix: Make 'A' a true row vector by enclosing it within an extra set of brackets. ("TRAN" will also transpose a matrix or vector on the 49G.) I noticed that, for whatever reason, the transpose made no difference in the vector's layout in Matrix Editor.

[14 14 14]T is the product B*AT -- i.e., the matrix times the column vector.

I struggled to get my 48G to do what I wanted in this example, also.

How counterintuitive! This deepens my appreciation for the HP-15C and HP-42S, both of which I would trust far more than any RPL model to use on an important exam.

-- KS



#11

[ 1 2 3 ]
is a column vector,

while

[[ 1 2 3 ]]
is a row vector.

The strange thing is that matrix editor doesn't seem to know the difference. Or does he?

Function key F2 toggles the vector mode. I checked it on the 48S, 48G and 49G+, all three have this toggle. The 49G+ uses a single boldface pair of brackets in stack display to denote a row vector while the older calculators keep the double pair of brackets.

I assume the RPL designers on the 28C/S wanted the more common vector type (column vector) to have the simpler notation. The matrix editor came into play much later.

Marcus


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: adding an entry to a vector Alberto Candel 12 3,911 12-02-2013, 01:18 PM
Last Post: Alberto Candel
  HP Prime - vector question bluesun08 3 1,745 11-18-2013, 07:26 PM
Last Post: Han
  HP Prime - Imlicit multiplication bluesun08 3 1,502 11-12-2013, 10:57 AM
Last Post: Han
  [HP-Prime CAS] Vector Calculus Library CompSystems 7 2,680 10-31-2013, 12:48 PM
Last Post: Han
  HP-Prime/Xcas: vector/list indexing fhub 6 2,774 10-27-2013, 04:52 PM
Last Post: fhub
  HP Prime : inconsistency with implicit multiplication in CAS Olivier Lecluse 6 2,265 10-27-2013, 03:30 AM
Last Post: parisse
  HP Prime: Vector field CURL(). How-to... Chris Tvergard 4 1,611 09-26-2013, 03:55 PM
Last Post: Chris Tvergard
  WP-34S: Program for vector (3D) manipulation Marcel Samek 4 1,774 09-05-2013, 05:29 AM
Last Post: Marcus von Cube, Germany
  [HP-Prime CAS] list[x,y,z], vector[x, y, z ] ... data type operation? CompSystems 1 1,174 08-22-2013, 03:30 PM
Last Post: Joe Horn
  Why does PEMDAS do multiplication and division before addition and subtraction? Don Shepherd 12 3,339 07-31-2013, 10:59 AM
Last Post: robert rozee

Forum Jump: