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 #85413 is a reply to message #85402] Thu, 01 August 2013 00:04 Go to previous message
Victor[2] is currently offline  Victor[2]
Messages: 5
Registered: July 2013
Junior Member
Sorry, I wrote the question bad, as you said I would want to control a multiplication of each element of the matrix (not a "classical" mathematical matrix multiplication)

And Yes, I knew that I can control the situation but I wanted to know if it is possible to work in the same way like Matlab ...

Thanks



On Tuesday, July 30, 2013 8:08:55 PM UTC+2, Phillip Bitzer wrote:
> 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 Nov 29 09:58:41 PST 2025

Total time taken to generate the page: 1.28207 seconds