determine the sum of fraction part for given matrix
a=1.8308 8.9172 6.7537
1.5853 10.2858 5.3804
6.5497 2.7572 1.5678
b=0.8308 0.9172 0.7537
0.5853 0.2858 0.3804
0.5497 0.7572 0.5678
Unfortunately, your checker does only include 4 digits of accuracy, and therefore the 'correct' solution is not accepted, only a hard-coded variant.
It is always better to have multiple tests, to avoid non-generic solutions to problems.
Hello, jamal hasoon. I completely agree with the preceding comment. Furthermore, it is very strongly recommended to write your own general solution code, to ensure compatibility of the inputs and the target solution in the Test Suite. —DIV
Alternatively, if you intend that users should round their results, then please include that instruction explicitly in the Problem Statement.
Another point: please do not include so much sample code in the Solution Template that is seen by everybody.
Lastly, it would be clearer to refer to the "decimal part" (or "fractional part"), rather than "fraction part".
See Problem 44521 for more ideas. —DIV
Number of 1s in a binary string
Return 'on' or 'off'
interesting center of magic matrix
Zigzag of square matrix
Minimum Maximum Sort Array
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office