{"id":6764,"date":"2022-06-13T11:57:52","date_gmt":"2022-06-13T02:57:52","guid":{"rendered":"https:\/\/blogs.mathworks.com\/japan-community\/?p=6764"},"modified":"2022-06-13T11:58:29","modified_gmt":"2022-06-13T02:58:29","slug":"programmingcontest-in-matlab-expo2022","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/japan-community\/2022\/06\/13\/programmingcontest-in-matlab-expo2022\/","title":{"rendered":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8 in MATLAB EXPO2022\uff01\uff01"},"content":{"rendered":"<p>\u7686\u3055\u3093\u3053\u3093\u306b\u3061\u306f\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c1\u30fc\u30e0\u306e\u9060\u85e4\u3067\u3059\u3002<\/p>\n<p>\u5148\u65e5\u95a2\u6771\u306e\u6885\u96e8\u5165\u308a\u5ba3\u8a00\u304c\u767a\u8868\u3055\u308c\u307e\u3057\u305f\u306d\u3002\u6700\u8fd1\u30aa\u30d5\u30a3\u30b9\u306b\u51fa\u793e\u3059\u308b\u6a5f\u4f1a\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001\u5bb6\u3092\u51fa\u308b\u6642\u306b\u96e8\u304c\u964d\u3063\u3066\u3044\u308b\u3068\u306a\u304b\u306a\u304b\u6c17\u304c\u6ec5\u5165\u308b\u2026\u2026\u3002\u81ea\u5e2d\u306b\u3064\u3044\u3066\u3059\u3050 MATLAB \u3092\u8d77\u52d5\u3057\u3066\u6697\u3044\u6c17\u5206\u3092\u6674\u3089\u3059\u65e5\u3005\u304c\u7d9a\u3044\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3055\u3066\u3001\u4eca\u56de\u306e\u8a18\u4e8b\u306f<a href=\"https:\/\/blogs.mathworks.com\/japan-community\/2022\/05\/31\/matlab-expo-japan-2022-twitter\/?from=jp\">\u524d\u56de\u8a18\u4e8b<\/a>\u306b\u7d9a\u304d\u30015\/25 \u306b\u884c\u308f\u308c\u305f <em><span style=\"color: #ff0000\"><strong>MATLAB EXPO 2022<\/strong> <\/span><\/em>\u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3068\u306a\u308a\u307e\u3059\u3002\u4eca\u5e74\u306e EXPO \u306f\u521d\u306e\u30cf\u30a4\u30d6\u30ea\u30c3\u30c9\u958b\u50ac\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u30aa\u30f3\u30e9\u30a4\u30f3\u53c2\u52a0\u3082\u542b\u3081\u3066\u5ef6\u3079 <strong><span style=\"color: #ff0000\">3000 \u4eba\u4ee5\u4e0a<\/span><\/strong><span style=\"color: #ff0000\"><span style=\"color: #000000\">\u306e\u65b9<\/span><\/span>\u306b\u3054\u53c2\u52a0\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002\u53c2\u52a0\u3044\u305f\u3060\u3044\u305f\u65b9\u306f\u69d8\u3005\u306a\u8b1b\u6f14\u3084\u5c55\u793a\u3092\u3054\u89a7\u3044\u305f\u3060\u3044\u305f\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u8a18\u4e8b\u3067\u306fEXPO\u306e\u73fe\u5730\u4f1a\u5834\u306e\u5965\u306e\u65b9\u3067\u3072\u3063\u305d\u308a\uff08\uff1f\uff09\u3068\u884c\u308f\u308c\u3066\u3044\u305f<span style=\"color: #ff0000\"><strong>\u300cMATLAB \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u300d<\/strong><\/span>\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\uff01<\/p>\n<p>&nbsp;<\/p>\n<h1><span style=\"color: #ff6600\">1. MATLAB \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u3068\u306f\uff1f<\/span><\/h1>\n<p>MATLAB \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u3068\u306f\u3001\u300cMATLAB \u3067\u3044\u304b\u306b\u304d\u308c\u3044\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3051\u308b\u304b\u300d\u3092\u7af6\u3044\u5408\u3046\u30b3\u30f3\u30c6\u30b9\u30c8\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"1366\" height=\"768\" class=\"alignnone size-full wp-image-6788\" src=\"https:\/\/blogs.mathworks.com\/japan-community\/files\/2022\/06\/screenshotProblemSolve.png\" alt=\"\" \/><\/p>\n<p>\u753b\u9762\u5de6\u306b\u69d8\u3005\u306a\u554f\u984c\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u306e\u7b54\u3048\u3068\u306a\u308b\u95a2\u6570\u3092 MATLAB \u3067\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u305d\u306e\u95a2\u6570\u306e<em><span style=\"color: #ff0000\"> <strong>&#8220;Solution Size&#8221;<\/strong><\/span><\/em> \u304c\u6700\u3082\u5c0f\u3055\u3044\u4eba\u304c\u5f97\u70b9\u306e\u30b2\u30c3\u30c8\u3067\u304d\u308b\u3001\u3068\u3044\u3046\u30eb\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Solution Size \u3068\u306f\u3001Cody\u2122 \u3067\u3082\u4f7f\u308f\u308c\u3066\u3044\u308b\u6307\u6a19\u3067\u3001\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3059\u308b\u3068\u304d\u306b\u5f97\u3089\u308c\u308b\u30ce\u30fc\u30c9\u30ab\u30a6\u30f3\u30c8\u3067\u3059\u3002\u30b3\u30fc\u30c9\u306e\u9577\u3055\u306b\u8fd1\u3044\u6307\u6a19\u3067\u3001\u4f8b\u3048\u3070\u6b21\u306e\u30b3\u30fc\u30c9\u306f Solution Size 12 \u3067\u3059\u3002<\/p>\n<pre><strong>Solution Size 12 \u306e\u30b3\u30fc\u30c9\uff1a<\/strong>\r\n<code><span style=\"color: #0000ff\">function<\/span> y = plus_one(x)\r\n  y = x + 1;\r\n<span style=\"color: #0000ff\">end<\/span><\/code><\/pre>\n<p>\u3053\u308c\u306b\u5bfe\u3057\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u306f Solution Size 16 \u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>Solution Size 16 \u306e\u30b3\u30fc\u30c9\uff1a<\/strong>\r\n<code><span style=\"color: #0000ff\">function<\/span> y = plus_one(x)\r\n  z = x;\r\n  y = z + 1;\r\n<span style=\"color: #0000ff\">end<\/span><\/code><\/pre>\n<p>\u3069\u3061\u3089\u3082\u95a2\u6570\u304b\u3089\u306e\u623b\u308a\u5024\u306f\u540c\u3058\u3067\u3059\u304c\u3001\u5f8c\u8005\u306e\u65b9\u304c 1 \u884c\u51e6\u7406\u304c\u591a\u3044\u306e\u3067\u3001Solution Size \u304c\u5897\u3048\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001\u7121\u99c4\u306a\u51e6\u7406\u3084\u5197\u9577\u306a\u8868\u73fe\u304c\u3042\u308b\u3068 Solution Size \u306f\u3069\u3093\u3069\u3093\u5897\u3048\u3066\u3044\u304f\u306e\u3067\u3001\u30d9\u30b9\u30c8\u306a Solution Size \u3092\u51fa\u3059\u306b\u306f \u8a00\u8a9e\u4ed5\u69d8\u3084\u30d3\u30eb\u30c8\u30a4\u30f3\u306e\u95a2\u6570\u3092\u4f7f\u3044\u3001\u3067\u304d\u308b\u3060\u3051\u30b7\u30f3\u30d7\u30eb\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u307e\u3068\u3081\u308b\u3068\u3001<span style=\"color: #ff0000\">\u300c<strong>MATLAB \u306e\u4fbf\u5229\u6a5f\u80fd\u30fb\u95a2\u6570\u3092\u3046\u307e\u304f\u4f7f\u3063\u3066\u3001\u3067\u304d\u308b\u3060\u3051\u77ed\u3044\u30b3\u30fc\u30c9\u3067\u95a2\u6570\u3092\u4f5c\u308d\u3046\uff01\u300d<\/strong><\/span>\u3068\u3044\u3046\u30b3\u30f3\u30c6\u30b9\u30c8\u3067\u3059\u306d\u3002<\/p>\n<h1><\/h1>\n<h1><span style=\"color: #ff6600\">2. \u5f53\u65e5\u306e\u30b3\u30f3\u30c6\u30b9\u30c8\u7d50\u679c<\/span><\/h1>\n<p>\u5f53\u65e5\u306f27\u4eba\u306e MATLAB \u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u306e\u7686\u3055\u3093\u306b\u53c2\u52a0\u3044\u305f\u3060\u304d\u307e\u3057\u305f\uff01\u3042\u3089\u304b\u3058\u3081\u7528\u610f\u3057\u3066\u3044\u305fPC\uff16\u53f0\u3060\u3051\u3067\u306f\u8db3\u308a\u305a\u3001\u4e88\u5099\u306ePC\u3082\u51fa\u3057\u3066\uff17\u4eba\u304c\u540c\u6642\u306b\u53c2\u52a0\u3059\u308b\u72b6\u614b\u306b\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"768\" class=\"aligncenter size-large wp-image-6860\" src=\"https:\/\/blogs.mathworks.com\/japan-community\/files\/2022\/06\/DSC_0124-1024x768.jpg\" alt=\"\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u6700\u7d42\u7684\u306a\u30b3\u30f3\u30c6\u30b9\u30c8\u7d50\u679c\u306f\u3068\u3044\u3046\u3068\u2026\u2026<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"768\" class=\"aligncenter size-large wp-image-6794\" src=\"https:\/\/blogs.mathworks.com\/japan-community\/files\/2022\/06\/FTlhSaaUYAAEqhW-1024x768.jpg\" alt=\"\" \/><\/p>\n<p>\u5348\u524d\u304b\u3089\u554f\u984c\u3092\u6012\u6d9b\u306e\u30b9\u30d4\u30fc\u30c9\u3067\u89e3\u304d\u307e\u304f\u3063\u3066\u3044\u305f masu\u3055\u3093\u304c\u30c0\u30f3\u30c8\u30c4\u306e\u30c8\u30c3\u30d7\uff01\u3057\u304b\u3057\u3001\u4e0a\u4f4d\uff15\u4eba\u306b\u8c6a\u83ef\u666f\u54c1\uff08\u6709\u511f\u306e\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c6\u30ad\u30b9\u30c8\uff01\uff09\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u305f\u3053\u3068\u3082\u3042\u308a\u3001\u7d42\u4e86\u6642\u9593\u30ae\u30ea\u30ae\u30ea\u307e\u3067\u4e0a\u4f4d\u4e89\u3044\u304c\u7e70\u308a\u5e83\u3052\u3089\u308c\u3066\u3044\u307e\u3057\u305f\uff01<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u306e masu \u3055\u3093\u306f<strong><span style=\"color: #ff0000\">\u30e9\u30a4\u30c8\u30cb\u30f3\u30b0\u30c8\u30fc\u30af\u3067\u767a\u8868\u3055\u308c\u3066\u3044\u305f\u30de\u30b9\u30e0\u30e9\u3055\u3093<\/span><\/strong>\u3067\u3059\u3002\u3084\u306f\u308a\u30e9\u30a4\u30c8\u30cb\u30f3\u30b0\u30c8\u30fc\u30af\u306e\u767a\u8868\u8005\u3068\u3082\u306a\u308b\u3068\u3001MATLAB \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u529b\u3082\u968f\u4e00\u3067\u3059\u306d\uff01<\/p>\n<p>\u305d\u3057\u3066\u30019 \u4f4d\u3067 20 \u70b9\u3092\u53d6\u3063\u3066\u3044\u308b &#8220;ekagaku&#8221; \u3055\u3093\u306f\u3001\u306a\u3093\u3068\u3001\u30e9\u30a4\u30c8\u30cb\u30f3\u30b0\u30c8\u30fc\u30af\u3068\u30dd\u30b9\u30bf\u30fc\u30bb\u30c3\u30b7\u30e7\u30f3\u3067\u767a\u8868\u3057\u3066\u3044\u305f<strong><span style=\"color: #ff0000\"> e-kagaku \u30a2\u30ab\u30c7\u30df\u30fc\u306e\u5c0f\u4e2d\u5b66\u751f\u306e\u7686\u3055\u3093<\/span><\/strong>\uff01\u5927\u4eba\u9854\u8ca0\u3051\u306e MATLAB \u30b9\u30ad\u30eb\u306b\u8131\u5e3d\u3067\u3059\u2026\u2026\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u203b\u30e9\u30a4\u30c8\u30cb\u30f3\u30b0\u30c8\u30fc\u30af\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/blogs.mathworks.com\/japan-community\/2022\/05\/31\/matlab-expo-japan-2022-twitter\/?from=jp\">\u524d\u56de\u306e\u8a18\u4e8b<\/a>\u3082\u3054\u89a7\u304f\u3060\u3055\u3044\u3002\u9332\u753b\u52d5\u753b\u3082\u00a0<a href=\"https:\/\/www.youtube.com\/c\/MATLABJapan\/videos\" class=\"external\" rel=\"nofollow\" target=\"_blank\">YouTube<\/a> \u306b\u3066\u968f\u6642\u516c\u958b\u3055\u308c\u3066\u3044\u304f\u4e88\u5b9a\u3067\u3059\u306e\u3067\u3001\u5f53\u65e5\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u304b\u3063\u305f\u65b9\u306f\u304a\u697d\u3057\u307f\u306b\uff01\uff08\u53bb\u5e74\u306e\u9332\u753b\u306f<a href=\"https:\/\/www.youtube.com\/hashtag\/2021%E3%83%A9%E3%82%A4%E3%83%88%E3%83%8B%E3%83%B3%E3%82%B0%E3%83%88%E3%83%BC%E3%82%AF\" class=\"external\" rel=\"nofollow\" target=\"_blank\">\u3053\u3061\u3089<\/a>\uff01\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>\u3055\u3066\u3001\u3053\u3053\u304b\u3089\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u3067\u5b9f\u969b\u306b\u51fa\u984c\u3055\u308c\u305f\u554f\u984c\u3068\u305d\u306e\u89e3\u7b54\u3092\u3001\u5c11\u3057\u3060\u3051\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u81ea\u5206\u306a\u3089\u3069\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u304b\u3001\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3093\u3067\u3044\u308b\u7686\u3055\u3093\u3082\u305c\u3072\u4e00\u7dd2\u306b\u8003\u3048\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<p>&nbsp;<\/p>\n<h1><span style=\"color: #ff6600\">3. \u5b9f\u969b\u306e\u554f\u984c\u3092\u898b\u3066\u307f\u3088\u3046\uff01\uff08\u521d\u7d1a\u7de8\uff09<\/span><\/h1>\n<p>\u307e\u305a\u306f\u5f53\u65e5\u6700\u3082\u7c21\u5358\u306a\u96e3\u6613\u5ea6\u3068\u3057\u3066\u51fa\u984c\u3055\u308c\u305f\u554f\u984c\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"padding-left: 30px\"><span style=\"color: #ff9900\"><em>(\u3053\u3053\u304b\u3089\u59cb\u3081\u3088\u3046) \u548c\u7b97<\/em><\/span><\/h2>\n<h2 style=\"padding-left: 30px\"><em><tt>N<\/tt> \u304c\u6b63\u306e\u6574\u6570\u306e\u5834\u5408\u30011 \u304b\u3089 <tt>N<\/tt> \u307e\u3067\u306e\u81ea\u7136\u6570\u306e\u548c\u3092\u8a08\u7b97\u3059\u308b\u95a2\u6570<\/em><\/h2>\n<h2 style=\"padding-left: 30px\"><em><b><tt>out = wasan(N)<\/tt><\/b><\/em><\/h2>\n<h2 style=\"padding-left: 30px\"><em>\u3092\u4f5c\u6210\u305b\u3088\u3002<\/em><\/h2>\n<h2><\/h2>\n<p>&nbsp;<\/p>\n<p>1 \u304b\u3089 N \u307e\u3067\u306e\u8db3\u3057\u7b97\u3092\u3059\u308b\u95a2\u6570\u3092\u4f5c\u308b\u554f\u984c\u3067\u3059\u3002\u7686\u3055\u3093\u306f\u3053\u306e\u95a2\u6570\u3001\u3069\u306e\u3088\u3046\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3057\u307e\u3059\u304b\uff1f<\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u306e\u8db3\u3057\u7b97\u3068\u3044\u3046\u3053\u3068\u3067\u3001 for \u30eb\u30fc\u30d7\u3092\u601d\u3044\u6d6e\u304b\u3079\u305f\u65b9\u3082\u3044\u3089\u3063\u3057\u3083\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u8a66\u3057\u306b for \u30eb\u30fc\u30d7\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>for \u30eb\u30fc\u30d7\u3092\u4f7f\u3063\u305f\u30b3\u30fc\u30c9\uff1a<\/strong>\r\n<code><span style=\"color: #0000ff\">function<\/span> out = wasan(N)\r\nout = 0;\r\n<span style=\"color: #0000ff\">for<\/span> i = 1:N\r\n    out = out + i;\r\n<span style=\"color: #0000ff\">end\r\nend<\/span><\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3057\u3087\u3046\u304b\uff1f\u3002\u3053\u306e\u30b3\u30fc\u30c9\u3067\u63a1\u70b9\u3057\u3066\u307f\u308b\u3068\u2026\u2026<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"518\" class=\"alignnone size-large wp-image-6821\" src=\"https:\/\/blogs.mathworks.com\/japan-community\/files\/2022\/06\/wasan_loop-1024x518.png\" alt=\"\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Solution Size \u306f 22\u3002\u6a21\u7bc4\u89e3\u7b54\u306e 14 \u3088\u308a\u3082\u5927\u5e45\u306b\u30b5\u30a4\u30ba\u304c\u5927\u304d\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002for \u30eb\u30fc\u30d7\u306f\u51e6\u7406\u304c\u591a\u3044\u5206 Solution Size \u304c\u5927\u304d\u304f\u306a\u308a\u304c\u3061\u3067\u3059\u3002\u3088\u308a\u5c0f\u3055\u306a Solution Size \u306b\u3059\u308b\u305f\u3081\u306b\u306f\u3001for \u30eb\u30fc\u30d7\u3092\u4f7f\u308f\u305a\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u7686\u3055\u3093\u306f\u3053\u306e\u554f\u984c\u3001\u3069\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3059\u304b\uff1f<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u3067\u306f\u3001\u6a21\u7bc4\u89e3\u7b54\u306e\u30b3\u30fc\u30c9\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>\u6a21\u7bc4\u89e3\u7b54\uff1a<\/strong>\r\n<code><span style=\"color: #0000ff\">function<\/span> out = wasan(N)\r\nout = sum(1:N);\r\n<span style=\"color: #0000ff\">end<\/span><\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u6a21\u7bc4\u89e3\u7b54\u306e\u30b3\u30fc\u30c9\u306f<span style=\"color: #ff0000\">\u308f\u305a\u304b\uff11\u884c<\/span>\uff01\u30dd\u30a4\u30f3\u30c8\u306f\u300c\u30d9\u30af\u30c8\u30eb\u3092\u3046\u307e\u304f\u4f7f\u3046\u300d\u3068\u3044\u3046\u70b9\u30021:N \u3067 1 \u304b\u3089 N \u307e\u3067\u306e\u30d9\u30af\u30c8\u30eb\u3092\u4f5c\u308a\u3001\u305d\u306e\u3059\u3079\u3066\u306e\u8981\u7d20\u3092 <a href=\"https:\/\/jp.mathworks.com\/help\/matlab\/ref\/sum.html\">sum<\/a> \u95a2\u6570\u3067\u5408\u8a08\u3059\u308b\u3053\u3068\u3067\u3001\u30eb\u30fc\u30d7\u306a\u3057\u3067\u7e70\u308a\u8fd4\u3057\u306e\u8db3\u3057\u7b97\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002MATLAB \u306f\u30d9\u30af\u30c8\u30eb\u3084\u884c\u5217\u306e\u6271\u3044\u306b\u9577\u3051\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3053\u308c\u3089\u3092\u6d3b\u7528\u3059\u308b\u3068\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306b\u30b3\u30fc\u30c9\u304c\u66f8\u3051\u307e\u3059\u306d\uff01<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1><span style=\"color: #ff6600\">4. \u5b9f\u969b\u306e\u554f\u984c\u3092\u898b\u3066\u307f\u3088\u3046\uff01<\/span><span style=\"color: #ff6600\">\uff08\u4e2d\u7d1a\u7de8\uff09<\/span><\/h1>\n<p>\u6b21\u306f\u5c11\u3057\u96e3\u6613\u5ea6\u306e\u9ad8\u3044\u554f\u984c\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"padding-left: 30px\"><span style=\"color: #ff9900\"><em>\u76f4\u89d2\u4e09\u89d2\u5f62\u306e\u5224\u5225<\/em><\/span><\/h2>\n<h2 style=\"padding-left: 30px\"><em>3\u8fba\u306e\u9577\u3055 x \u3092\u5165\u529b\u3068\u3057\u305f\u3068\u304d\u3001x=[3 4 5]\u306f\u76f4\u89d2\u4e09\u89d2\u5f62\u3067\u3059\u3002<\/em><\/h2>\n<h2 style=\"padding-left: 30px\"><em>x = [13 5 12]\u3082\u76f4\u89d2\u4e09\u89d2\u5f62\u3067\u3059\u3002<\/em><\/h2>\n<h2 style=\"padding-left: 30px\"><em>x = [5 5 5]\u306f\u76f4\u89d2\u4e09\u89d2\u5f62\u3067\u306f\u306a\u308a\u307e\u305b\u3093\u3002<\/em><\/h2>\n<h2 style=\"padding-left: 30px\"><em>3\u8981\u7d20\u306e\u30d9\u30af\u30c8\u30eb x \u3092\u5165\u529b\u3068\u3057\u305f\u3068\u304d\u306b\u3001\u76f4\u89d2\u4e09\u89d2\u5f62\u3067\u3042\u308c\u3070 true \u3092\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070 false \u3092\u8fd4\u3059\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/em><\/h2>\n<h2 style=\"padding-left: 30px\"><em>TF = RightTriangle(x)<\/em><\/h2>\n<p>&nbsp;<\/p>\n<p>\u4e0e\u3048\u3089\u308c\u305f\u4e09\u89d2\u5f62\u306e\uff13\u8fba\u306e\u9577\u3055\u304b\u3089\u3001\u76f4\u89d2\u4e09\u89d2\u5f62\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308b\u554f\u984c\u3067\u3059\u3002\uff13\u8981\u7d20\u306e\u30d9\u30af\u30c8\u30eb\u306e\u3046\u3061\u6700\u5927\u306e\u8981\u7d20\u306e\uff12\u4e57\u304c\u4ed6\u306e\u8981\u7d20\u306e\uff12\u4e57\u548c\u3068\u540c\u3058\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308c\u3070\u3001\u76f4\u89d2\u4e09\u89d2\u5f62\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u2026\u2026\u3068\u3001\u8a00\u8449\u306b\u3059\u308c\u3070\u7c21\u5358\u305d\u3046\u3067\u3059\u304c\u3001\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3053\u3046\u3068\u3059\u308b\u3068\u610f\u5916\u3068\u3046\u307e\u304f\u3044\u304d\u307e\u305b\u3093\u3002\u7279\u306b\u96e3\u3057\u3044\u306e\u304c\u3001\u8fba\u306e\u9577\u3055\u306e\u9806\u756a\u3067\u4e26\u3093\u3067\u3044\u308b\u3068\u306f\u9650\u3089\u306a\u3044\u3068\u3044\u3046\u70b9\u3002<a href=\"https:\/\/jp.mathworks.com\/help\/matlab\/ref\/max.html\">max<\/a> \u95a2\u6570\u3092\u4f7f\u3048\u3070\u6700\u5927\u5024\u306f\u53d6\u308c\u307e\u3059\u304c\u3001\u4eca\u5ea6\u306f\u305d\u308c\u4ee5\u5916\u306e\u8981\u7d20\u3060\u3051\u3092\u53d6\u308a\u51fa\u3059\u306e\u304c\u5927\u5909\u3002if \u6587\u3092\u4f7f\u3063\u3066\u3069\u306e\u8981\u7d20\u304c\u6700\u5927\u304b\u306b\u3088\u3063\u3066\u5834\u5408\u5206\u3051\u3092\u3059\u308b\uff1f\u3067\u3082\u305d\u3046\u3059\u308b\u3068\u30b3\u30fc\u30c9\u304c\u9577\u304f\u306a\u3063\u3066 Solution Size \u304c\u2026\u2026\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u2026\u2026\u3060\u3093\u3060\u3093\u982d\u304c\u6df7\u4e71\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u7686\u3055\u3093\u306f\u3053\u306e\u554f\u984c\u3001\u30ad\u30ec\u30a4\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u304d\u307e\u3059\u304b\uff1f<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u305d\u308c\u3067\u306f\u6a21\u7bc4\u89e3\u7b54\u3092\u2026\u2026\u3068\u8a00\u3044\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u304c\u3001\u306a\u3093\u3068\u3053\u306e\u554f\u984c\u3001<a href=\"https:\/\/twitter.com\/km_MATLAB_Amb?s=20&amp;t=3QE193vL3yrQknFXwSdZuQ\" class=\"external\" rel=\"nofollow\" target=\"_blank\">\u65e9\u7a32\u7530\u5927\u5b66\u306e MATLAB \u30a2\u30f3\u30d0\u30b5\u30c0\u30fc\u306e\u65b9<\/a>\u304c\u6a21\u7bc4\u89e3\u7b54\u3088\u308a\u3082\u30b5\u30a4\u30ba\u306e\u77ed\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u304f\u308c\u307e\u3057\u305f\uff01\u305d\u306e\u83ef\u9e97\u306a\u30b3\u30fc\u30c9\u304c\u3053\u3061\u3089\uff01<\/p>\n<pre><strong>MATLAB \u30a2\u30f3\u30d0\u30b5\u30c0\u30fc\u306e\u65b9\u306e\u89e3\u7b54\uff1a<\/strong>\r\n<code><span style=\"color: #0000ff\">function<\/span> TF = RightTriangle(x)\r\nTF = (sort(x).^2)*[1;1;-1]==0;\r\n<span style=\"color: #0000ff\">end<\/span><\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u306a\u3093\u3068\u3001\u3053\u306e\u8907\u96d1\u306a\u51e6\u7406\u3092<strong><span style=\"color: #ff0000\">\u308f\u305a\u304b\uff11\u884c<\/span><\/strong>\u3067\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3001\u30b9\u30b4\u3044\uff01\u65e9\u901f\u4e2d\u8eab\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u307e\u305a\u4f7f\u3063\u3066\u3044\u308b\u306e\u304c <a href=\"https:\/\/jp.mathworks.com\/help\/matlab\/ref\/sort.html\">sort<\/a> \u95a2\u6570\u3002sort \u95a2\u6570\u306f\u30d9\u30af\u30c8\u30eb\u306e\u8981\u7d20\u3092\u5c0f\u3055\u3044\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3092\u4f7f\u3048\u3070\u5148\u307b\u3069\u306e\u8fba\u306e\u9577\u3055\u306e\u9806\u756a\u306e\u554f\u984c\u304c\u89e3\u6c7a\u3067\u304d\u307e\u3059\u306d\uff01<\/p>\n<p>\u305d\u3057\u3066\u305d\u306e\u5f8c\u306e\u8a08\u7b97\u3082\u304a\u898b\u4e8b\u3002&#8221;.^&#8221; \u6f14\u7b97\u306b\u3088\u3063\u3066\u3001sort \u3067\u4e26\u3073\u66ff\u3048\u305f\u30d9\u30af\u30c8\u30eb\u306e\u5404\u8981\u7d20\u3092\uff12\u4e57\u3057\u307e\u3059\u3002MATLAB \u3067\u306f\u3001\u639b\u3051\u7b97\u3084\u3079\u304d\u4e57\u306e\u6f14\u7b97\u306e\u524d\u306b . \u3092\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u8981\u7d20\u3054\u3068\u306e\u6f14\u7b97\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff08\u3053\u308c\u3092<a href=\"https:\/\/jp.mathworks.com\/help\/matlab\/matlab_prog\/array-vs-matrix-operations.html#bu90xxy-1\">\u914d\u5217\u6f14\u7b97<\/a>\u3068\u547c\u3073\u307e\u3059\uff09\u3002\u3042\u3068\u306f\u5404\u8fba\u306e\u9577\u3055\u306e\uff12\u4e57\u3067\u69cb\u6210\u3055\u308c\u305f\u6a2a\u30d9\u30af\u30c8\u30eb[x1^2 x2^2 x3^2]\u3068\u7e26\u30d9\u30af\u30c8\u30eb [1;1;-1] \u3092\u639b\u3051\u7b97\u3059\u308b\u3053\u3068\u3067\u3001x1^2+x2^2-x3^2 \u3092\u8a08\u7b97\u3057\u307e\u3059\u3002sort \u95a2\u6570\u306b\u3088\u3063\u3066 x3 \u304c\u6700\u5927\u5024\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u76f4\u89d2\u4e09\u89d2\u5f62\u3067\u3042\u308c\u3070\u3053\u306e\u8a08\u7b97\u7d50\u679c\u306f 0 \u306b\u306a\u308b\u306f\u305a\u3002\u305d\u306e\u305f\u3081\u3001\u6700\u5f8c\u306b == 0 \u306b\u3088\u3063\u3066 0 \u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308c\u3070\u3001\u76f4\u89d2\u4e09\u89d2\u5f62\u304b\u3069\u3046\u304b\u306e\u5224\u5b9a\u304c\u3067\u304d\u308b\u3001\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u307e\u3055\u306b <span style=\"color: #ff0000\"><strong>MATLAB \u306e\u4fbf\u5229\u95a2\u6570\u3068\u8a00\u8a9e\u4ed5\u69d8\u3092\u6700\u5927\u9650\u306b\u6d3b\u304b\u3057\u305f\u30b3\u30fc\u30c9<\/strong><\/span>\u3067\u3059\u306d\uff01\u3055\u3059\u304c\u306f MATLAB \u30a2\u30f3\u30d0\u30b5\u30c0\u30fc\uff01<\/p>\n<p>&nbsp;<\/p>\n<blockquote class=\"twitter-tweet\" data-width=\"500\" data-dnt=\"true\">\n<p lang=\"ja\" dir=\"ltr\">\u6a21\u7bc4\u89e3\u7b54\u8d8a\u3048\ud83d\ude0e<\/p>\n<p>3\u89d2\u5f62\u306e3\u8fba\u306e\u9577\u3055a, b, c\u304c\u4e0e\u3048\u3089\u308c\u305f\u6642\u3001\u305d\u306e\u4e09\u89d2\u5f62\u304c\u76f4\u89d2\u4e09\u89d2\u5f62\u3067\u3042\u308b\u304b\u3092\u5224\u5b9a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\uff62\u306a\u308b\u3079\u304f\u77ed\u304f\uff63\u66f8\u304f\u554f\u984c\u3067\u3059 <a href=\"https:\/\/t.co\/M5tYfCPPc6\" class=\"external\" rel=\"nofollow\" target=\"_blank\">pic.twitter.com\/M5tYfCPPc6<\/a><\/p>\n<p>&mdash; K.M.@MATLAB Ambassador (@km_MATLAB_Amb) <a href=\"https:\/\/twitter.com\/km_MATLAB_Amb\/status\/1529408475465256961?ref_src=twsrc%5Etfw\" class=\"external\" rel=\"nofollow\" target=\"_blank\">May 25, 2022<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>&nbsp;<\/p>\n<h1><span style=\"color: #ff6600\">5. \u7d42\u308f\u308a\u306b<\/span><\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001MATLAB EXPO \u3067\u958b\u50ac\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u306e\u554f\u984c\u3092\uff12\u554f\u307b\u3069\u7d39\u4ecb\u3057\u307e\u3057\u305f\u304c\u3001\u7686\u3055\u3093\u306f\u3069\u3061\u3089\u306e\u554f\u984c\u3082\u89e3\u3051\u307e\u3057\u305f\u304b\uff1f\u5b9f\u969b\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u3067\u306f\u3001\u521d\u7d1a\u3001\u4e2d\u7d1a\u3001\u305d\u3057\u3066\u3055\u3089\u306b\u96e3\u3057\u3044\u4e0a\u7d1a\u554f\u984c\u3082\u542b\u3081\u300170\u554f\u4ee5\u4e0a\u306e\u554f\u984c\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u300c\u81ea\u5206\u306eMATLAB \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30ad\u30eb\u3092\u8a66\u3057\u305f\u3044\uff01\u300d\u300c\u79c1\u304c\u6700\u5f37\u306eMATLAB \u30a8\u30f3\u30b8\u30cb\u30a2\u3060\uff01\u300d\u3068\u3044\u3046\u65b9\u306f\u3001\u305c\u3072\u6765\u5e74\u306e MATLAB EXPO \u306f\u4f1a\u5834\u306b\u304a\u8d8a\u3057\u3044\u305f\u3060\u304d\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c8\u306b\u6311\u6226\u3057\u306b\u6765\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/japan-community\/files\/2022\/06\/screenshotProblemSolve.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>\u7686\u3055\u3093\u3053\u3093\u306b\u3061\u306f\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30c1\u30fc\u30e0\u306e\u9060\u85e4\u3067\u3059\u3002<br \/>\n\u5148\u65e5\u95a2\u6771\u306e\u6885\u96e8\u5165\u308a\u5ba3\u8a00\u304c\u767a\u8868\u3055\u308c\u307e\u3057\u305f\u306d\u3002\u6700\u8fd1\u30aa\u30d5\u30a3\u30b9\u306b\u51fa\u793e\u3059\u308b\u6a5f\u4f1a\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001\u5bb6\u3092\u51fa\u308b\u6642\u306b\u96e8\u304c\u964d\u3063\u3066\u3044\u308b\u3068\u306a\u304b\u306a\u304b\u6c17\u304c\u6ec5\u5165\u308b\u2026\u2026\u3002\u81ea\u5e2d\u306b\u3064\u3044\u3066\u3059\u3050 MATLAB \u3092\u8d77\u52d5\u3057\u3066\u6697\u3044\u6c17\u5206\u3092\u6674\u3089\u3059\u65e5\u3005\u304c\u7d9a\u3044\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n&nbsp;<br \/>\n\u3055\u3066\u3001\u4eca\u56de\u306e\u8a18\u4e8b\u306f\u524d\u56de\u8a18\u4e8b\u306b\u7d9a\u304d\u30015\/25 \u306b\u884c\u308f\u308c\u305f MATLAB EXPO 2022&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/japan-community\/2022\/06\/13\/programmingcontest-in-matlab-expo2022\/\">read more >><\/a><\/p>\n","protected":false},"author":169,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[73,59,47],"tags":[67,21],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/posts\/6764"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/users\/169"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/comments?post=6764"}],"version-history":[{"count":60,"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/posts\/6764\/revisions"}],"predecessor-version":[{"id":6965,"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/posts\/6764\/revisions\/6965"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/media?parent=6764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/categories?post=6764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/japan-community\/wp-json\/wp\/v2\/tags?post=6764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}