[ncl-talk] multiplication of two martixes

Gus Correa gus at ldeo.columbia.edu
Sat Feb 16 07:57:41 MST 2019


Check if the orginal matrices a and b have entries with _FillValue, which
is probably the
default 9.969209968386869e+36 that you see in the result.

_FillValue elements in your matrices mean the data is undefined, not a
number.
Hence, you can't multiply them legitimately, from the Mathematics point of
view.

One workaround, which is not necessarily what you want or even
mathematically sound,
would be to replace the _FillValue entries in a and b by 1.0 (the neutral
element for
multiplication).
That can be done using the "where" function, before you multiply.
However, the right way to go about it is to start with matrices with no
_FillValue.

I hope this helps,
Gus Corea

On Sat, Feb 16, 2019 at 9:12 AM Chen <kuroshio at 163.com> wrote:

> Dear friends,
>  I am using "#" to compute the product of two martrixes. For example,
> c=a#b. Then I got a martrix which all its values are 9.969209968386869e+36.
> I believe it has something to do with its Fill_value, but how can I solve
> this problem?
> Please, help me. Thanks.
> Chen
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190216/c84a9850/attachment.html>


More information about the ncl-talk mailing list