comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Is it possible to generate an error when it is tried to multiply matrix with different dimensions?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Is it possible to generate an error when it is tried to multiply matrix with different dimensions? [message #85402 is a reply to message #85386] Tue, 30 July 2013 11:08 Go to previous messageGo to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
You could always check before multiplying:

IF N_ELEMENTS(a) EQ N_ELEMENTS(b) THEN c= a*b ELSE MESSAGE, "different number of elements"

and let your error handler "catch" the error.

An FYI - this isn't *really* matrix multiplication. What you're doing is multiplying each element of the arrays together. If you're interested in matrix multiplication, check out:

http://www.exelisvis.com/docs/Matrix_Operators.html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: image(/buffer) & colorbar result in seg fault
Next Topic: Re: Asynchronous IDL_IDLBridge causing memory leak

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 13:45:54 PDT 2025

Total time taken to generate the page: 1.67987 seconds