Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
I don't know why I getting this kind of result.. I tried everything. It is on page 15 . I use prime 9
Thanks in advance for your help
Solved! Go to Solution.
Whenever in any calculation a NaN is involved, the result is NaN.
Maybe a utility function to do the vector multiplication ignoring any multiplications with NaN involved could help:
Applied to your calculation it looks like this:
Is this somewhere near to what you expected?
The calculation takes some time as Prime has to multiply 3669*2=7338 times two 3670x1 vectors and a user-written function using augment and filterNaN isn't very fast.
Prime 9 sheet attached
@YA_10963798 wrote:
I don't know why I getting this kind of result.. I tried everything. It is on page 15 . I use prime 9
When you multiply any pair of vectors that contain at least one NaN, the result is also a NaN.
Stuart
I've got Mathcad Prime 10, so I can't post a worksheet that's useful to you. Sorry.
so that means the whole results will be NaN.. and that will erase all other results?.
thank you for trying . I appreciate your time
Whenever in any calculation a NaN is involved, the result is NaN.
Maybe a utility function to do the vector multiplication ignoring any multiplications with NaN involved could help:
Applied to your calculation it looks like this:
Is this somewhere near to what you expected?
The calculation takes some time as Prime has to multiply 3669*2=7338 times two 3670x1 vectors and a user-written function using augment and filterNaN isn't very fast.
Prime 9 sheet attached
Thank you that solved my problem
@Werner_E wrote:
Whenever in any calculation a NaN is involved, the result is NaN.
Maybe a utility function to do the vector multiplication ignoring any multiplications with NaN involved could help:
The calculation takes some time as Prime has to multiply 3669*2=7338 times two 3670x1 vectors and a user-written function using augment and filterNaN isn't very fast.
Out of idle curiosity, I wondered what you meant by "takes some time". Now I know.
Surprisingly, a brute force and ignorance method offers better performance.
Stuart
Not such a big surprise. I suspect that "filterNaN" is the main bottleneck and not "augment" or the column selector.
The if function seems to be faster even though its used in the loop.
@Werner_E wrote:
Not such a big surprise. I suspect that "filterNaN" is the main bottleneck and not "augment" or the column selector.
The if function seems to be faster even though its used in the loop.
Indeed, filterNaN does seem to be the larger bottleneck. However, augment is not entirely innocent in these proceedings.
Stuart