科迪< / p >
Well I found this one fun to figure out, all you have to do is make a matrix of 1's or 0's (true or false) that show whether or not a number in a matrix is sitting directly next to (a neighbor) that is number that is +1 or -1 or == to that of the original number. Here are some examples:
M1 = [1 2 1; 5 6 7; 2 3 6]
SO now find numbers next to one another that are +1 of each-other.
output = [1 1 1; 1 1 1; 1 1 1] One more:
M2 = [8 8 8; 4 4 4; 1 9 7]
output = [1 1 1; 1 1 1; 0 0 0]
One more:
M3 = [1 8 5; 4 10 22; 1 66 7]
output = [0 0 0; 0 0 0; 0 0 0]
Well good luck!
好问题。你应该通过更多的测试(矩阵的大小,不同的间隙……)来概括它。我怀疑我的解决方案不正确。< / p >
解决方案343420
这样不行,科迪真棒!!< / p >
添加两个数字
解决30617< / p >
提取前导非零位
解决1325< / p >
求给定向量的长度
解决4669< / p >
做一个1热向量
解决440< / p >
四舍五入数为n个小数
解决1619< / p >
哦,0 0 0 !!
解决204< / p >
求下一个质数
解决283< / p >
扑克卡交易!
43岁的解决者< / p >
你能中彩票吗?
解决42< / p >
在1的值之间计数连续的0
解决197< / p >
在MATLAB中心找到宝藏,并发现社区如何可以帮助你!< / p >开始狩猎!
选择一个网站,在那里获得翻译的内容,并看到当地的活动和优惠。根据您的位置,我们建议您选择:.< / p >选择网站
你也可以从以下列表中选择一个网站:< / p >
选择中国网站(中文或英文)以获得最佳网站性能。其他MathWorks国家站点没有针对您所在位置的访问进行优化。< / p >
与当地办事处联系