Problem 117. Distance walked 3D
解决方案统计
问题评论
-
2条评论
非常好 !
please explain the problem
解决方案评论
-
1条评论
REGEXP黑客
-
1条评论
REGEXP黑客
-
3条评论
我对您在此处使用的功能感到困惑(也在解决方案116288中)。它不再在Cody上工作(请参阅解决方案1461162),我找不到文档(在工具箱中除外 - 既通过“手动”在线搜索和使用“ help”命令)。它是被删除的内置功能,还是演示的一部分?
我现在可用的DIST函数位于C:\ Program Files \ Matlab \ R2016B \ toolbox \ nnet \ nnet \ nndistance \ nndistance \ dist.m
Maybe it's no longer there in R2017b (Cody, at this moment), or the neural networking toolbox was available back then, and not now in Cody. I don't know.
谢谢。似乎确实在Cody上可以使用“ DIST”功能...即使它“不应该有效”(因为它是工具箱的一部分)。请参阅Ned Gully在2014年2月13日在问题317的评论。
-
1条评论
REGEXP黑客
-
1条评论
I like this solution
-
3条评论
Brilliant!
你能解释这个问题吗?从[3 4 2]步行到[0 0 2],给出(3-0)+(4-0)= 7个单位。然后从[0 0 2]到[0 1 2]给出1个单位。从[0 1 2]到[1 1 2]给出1个单位,最后从[1 1 2]到[1 1 20]给出18个单位。那么距离的总和是7+1+1+18 = 27。
Walking from [3 4 2] to [0 0 2] is the same as walking DIRECT (along a 'diagonal') from the FIRST point that is 3 metres East, 4 metres North and 2 metres Elevated from the Origin to a SECOND point that is 0 metres East, 0 metres North and 2 metres Elevated from the Origin. As the Elevation hasn't changed in this leg of the trip, the distance reduces to the length of the hypotenuse of a right-angled triangle whose other sides are 3m and 4m, namely a length of 5 metres.