{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-16T00:12:35.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-16T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":44611,"title":"¡Busca el extremo!","description":"Crea una función que calcule el extremo de una parábola (máximo o mínimo absoluto) cuyos datos son proporcionados por el usuario en base a la siguiente ecuación. \r\n\r\ny = a*x^2+b\r\n\r\nEl usuario indicará los valores de *a* y *b* mientras que los valores de *x* se encontrarán en todos los casos entre -10 y +10. Se debe redondear la respuesta al número entero más cercano.\r\n\r\n* *Ejemplo*\r\n\r\nEl mínimo absoluto de la parábola y = x^2-5 es P(0,-5).","description_html":"\u003cp\u003eCrea una función que calcule el extremo de una parábola (máximo o mínimo absoluto) cuyos datos son proporcionados por el usuario en base a la siguiente ecuación.\u003c/p\u003e\u003cp\u003ey = a*x^2+b\u003c/p\u003e\u003cp\u003eEl usuario indicará los valores de \u003cb\u003ea\u003c/b\u003e y \u003cb\u003eb\u003c/b\u003e mientras que los valores de \u003cb\u003ex\u003c/b\u003e se encontrarán en todos los casos entre -10 y +10. Se debe redondear la respuesta al número entero más cercano.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eEjemplo\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eEl mínimo absoluto de la parábola y = x^2-5 es P(0,-5).\u003c/p\u003e","function_template":"function y = calculo_maxmin(a,b)\r\n  \r\nend","test_suite":"%% TEST 1\r\na = 2;\r\nb = -8;\r\nmin_correct = -8;\r\nassert(isequal(calculo_maxmin(a,b),min_correct))\r\n\r\n%% TEST 2 \r\na = -2;\r\nb = -8;\r\nmin_correct = -8;\r\nassert(isequal(calculo_maxmin(a,b),min_correct))\r\n\r\n%% TEST 3\r\na = -5;\r\nb = 0;\r\nmin_correct = 0;\r\nassert(isequal(calculo_maxmin(a,b),min_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":132597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-16T07:17:45.000Z","updated_at":"2026-04-08T12:50:35.000Z","published_at":"2018-04-17T18:00:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCrea una función que calcule el extremo de una parábola (máximo o mínimo absoluto) cuyos datos son proporcionados por el usuario en base a la siguiente ecuación.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = a*x^2+b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEl usuario indicará los valores de\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e y\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mientras que los valores de\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e se encontrarán en todos los casos entre -10 y +10. Se debe redondear la respuesta al número entero más cercano.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEl mínimo absoluto de la parábola y = x^2-5 es P(0,-5).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44841,"title":"Cody problems in French : Trouvez la logique Pt.2","description":"Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage.\r\n\r\nP.S: L'utilisation de \"^\" est de nouveau fortement conseillée","description_html":"\u003cp\u003eTrouvez la logique entre x et y, aidez-vous de la test suite. Bon courage.\u003c/p\u003e\u003cp\u003eP.S: L'utilisation de \"^\" est de nouveau fortement conseillée\u003c/p\u003e","function_template":"function y = logic2(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(logic2(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 512;\r\nassert(isequal(logic2(x),y_correct))\r\n%%\r\nx = 0;\r\ny_correct = 0;\r\nassert(isequal(logic2(x),y_correct))\r\n%%\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":280631,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-01-28T14:29:40.000Z","updated_at":"2026-02-06T09:41:48.000Z","published_at":"2019-01-28T14:29:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTrouvez la logique entre x et y, aidez-vous de la test suite. Bon courage.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eP.S: L'utilisation de \\\"^\\\" est de nouveau fortement conseillée\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44615,"title":"¿Es una función exponencial?","description":"Crea una función que permita analizar si los datos dados por el usuario ( *x* e *y*) se relacionan por medio de una función exponencial de la forma y = e^x. Para la comprobación redondea al primer decimal más cercano.\r\n\r\n* *Ejemplo*\r\n\r\nx = [1 2 3 4 5 6 7 8 9 10]\r\ny = [1\t2,7 7,4\t20,1 54,6 148,4\t403,4 1096,6 2981 8103,1 22026,5]\r\n\r\n*Sí* es una relación exponencial, por lo que la respuesta de la función creada será un 1 lógico.","description_html":"\u003cp\u003eCrea una función que permita analizar si los datos dados por el usuario ( \u003cb\u003ex\u003c/b\u003e e \u003cb\u003ey\u003c/b\u003e) se relacionan por medio de una función exponencial de la forma y = e^x. Para la comprobación redondea al primer decimal más cercano.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eEjemplo\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003ex = [1 2 3 4 5 6 7 8 9 10]\r\ny = [1\t2,7 7,4\t20,1 54,6 148,4\t403,4 1096,6 2981 8103,1 22026,5]\u003c/p\u003e\u003cp\u003e\u003cb\u003eSí\u003c/b\u003e es una relación exponencial, por lo que la respuesta de la función creada será un 1 lógico.\u003c/p\u003e","function_template":"function respuesta = comprobacion_exp(x,y)\r\n  \r\nend","test_suite":"%% TEST 1\r\nx = 0:1:10;\r\ny = [1 2.7 7.4 20.1 54.6 148.4 403.4 1096.6 2981 8103.1 22026.5];\r\nrespuesta_correcta = logical(1);\r\nassert(isequal(comprobacion_exp(x,y),respuesta_correcta))\r\n\r\n%% TEST 2\r\nx = 10:1:20;\r\ny = [22026.5 59874.1 162754.8 442413.4 1202604.3 3269017.4 8886110.5 24154952.8 65659969.1 178482301 485165195.4];\r\nrespuesta_correcta = logical(1);\r\nassert(isequal(comprobacion_exp(x,y),respuesta_correcta))\r\n\r\n%% TEST 3\r\nx = 10:1:20;\r\ny = [22026.5 59876.1 162754.8 442413.4 1202604.3 3269017.4 8886110.5 24154952.8 65659969.1 178482301 485165195.4];\r\nrespuesta_correcta = logical(0);\r\nassert(isequal(comprobacion_exp(x,y),respuesta_correcta))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":132597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":28,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-17T07:29:25.000Z","updated_at":"2026-03-05T15:53:44.000Z","published_at":"2018-04-17T17:57:57.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCrea una función que permita analizar si los datos dados por el usuario (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e) se relacionan por medio de una función exponencial de la forma y = e^x. Para la comprobación redondea al primer decimal más cercano.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex = [1 2 3 4 5 6 7 8 9 10] y = [1 2,7 7,4 20,1 54,6 148,4 403,4 1096,6 2981 8103,1 22026,5]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSí\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e es una relación exponencial, por lo que la respuesta de la función creada será un 1 lógico.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44409,"title":"特定の値がベクトル内に含まれているかを確認するコードを書こう","description":"ベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。\r\n\r\n例: \r\n\r\n  a = 3;\r\n  b = [1,2,4];\r\n\r\nスカラ値 3 はベクトル b に含まれていないので、関数は 0 を返します。 \r\n\r\n  a = 3;\r\n  b = [1,2,3];\r\n\r\nスカラ値 3 はベクトル b に含まれているので、関数は 1 を返します。\r\n\r\n* (英語版) Problem 838. Check if number exists in vector\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/838\u003e","description_html":"\u003cp\u003eベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = 3;\r\nb = [1,2,4];\r\n\u003c/pre\u003e\u003cp\u003eスカラ値 3 はベクトル b に含まれていないので、関数は 0 を返します。\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = 3;\r\nb = [1,2,3];\r\n\u003c/pre\u003e\u003cp\u003eスカラ値 3 はベクトル b に含まれているので、関数は 1 を返します。\u003c/p\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 838. Check if number exists in vector \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/838\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/838\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = existsInVector(a,b)\r\n  y = [a,b];\r\nend","test_suite":"%%\r\na = 1;\r\nb = [1,2];\r\ny_correct = 1;\r\nassert(isequal(existsInVector(a,b),y_correct))\r\n%%\r\na = 12;\r\nb = [1,3,4,5,6,7,8,1,2];\r\ny_correct = 0;\r\nassert(isequal(existsInVector(a,b),y_correct))\r\n%%\r\na = -1;\r\nb = [1,2];\r\ny_correct = 0;\r\nassert(isequal(existsInVector(a,b),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":342,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-16T01:23:39.000Z","updated_at":"2026-03-16T19:21:59.000Z","published_at":"2017-11-16T01:23:39.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = 3;\\nb = [1,2,4];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eスカラ値 3 はベクトル b に含まれていないので、関数は 0 を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = 3;\\nb = [1,2,3];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eスカラ値 3 はベクトル b に含まれているので、関数は 1 を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 838. Check if number exists in vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/838\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/838\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2289,"title":"サイコロを作ろう","description":"1から6までの独立かつランダムな数値を返すような関数を作成しましょう。\r\n\r\n例：\r\n\r\n  \u003e\u003e [x1,x2] = rollDice();\r\n\r\nと入力すると\r\n\r\n  x1 = 5\r\n  x2 = 2\r\n\r\nのような解を返します。","description_html":"\u003cp\u003e1から6までの独立かつランダムな数値を返すような関数を作成しましょう。\u003c/p\u003e\u003cp\u003e例：\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e\u0026gt;\u0026gt; [x1,x2] = rollDice();\r\n\u003c/pre\u003e\u003cp\u003eと入力すると\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex1 = 5\r\nx2 = 2\r\n\u003c/pre\u003e\u003cp\u003eのような解を返します。\u003c/p\u003e","function_template":"function [x1 x2] = rollDice(x)\r\n  x1 = x;\r\n  x2 = x;\r\nend","test_suite":"%%\r\nx1 = zeros(1,6000);\r\nx2 = zeros(1,6000);\r\nfor ii = 1:6000\r\n    [x1(ii),x2(ii)] = rollDice();\r\nend\r\nnumCt = sum( bsxfun( @eq, x1, (1:6)' ), 2 ) + sum( bsxfun( @eq, x2, (1:6)' ), 2 );\r\nassert(all(round(numCt/200) == 10) \u0026\u0026 sum(numCt) == 12000)","published":true,"deleted":false,"likes_count":6,"comments_count":4,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":404,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2014-04-16T07:43:57.000Z","updated_at":"2026-03-16T19:03:50.000Z","published_at":"2014-04-16T07:48:39.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1から6までの独立かつランダムな数値を返すような関数を作成しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例：\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[\u003e\u003e [x1,x2] = rollDice();]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eと入力すると\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x1 = 5\\nx2 = 2]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eのような解を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44420,"title":"文字列の最初と最後の文字だけ抜き出しましょう。","description":"文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。\r\nもし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\r\n\r\n例:\r\n\r\n   stringfirstandlast('boring example') = 'be'\r\n\r\n* (英語版) Problem 649. Return the first and last character of a string\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/649\u003e\r\n","description_html":"\u003cp\u003e文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。\r\nもし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e   stringfirstandlast('boring example') = 'be'\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 649. Return the first and last character of a string \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/649\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/649\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = stringfirstandlast(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'abcde';\r\ny_correct = 'ae';\r\nassert(isequal(stringfirstandlast(x),y_correct))\r\n%%\t\r\nx = 'a';\r\ny_correct = 'aa';\r\nassert(isequal(stringfirstandlast(x),y_correct))\r\n%%\t\r\nx = 'codyrocks!';\r\ny_correct = 'c!';\r\nassert(isequal(stringfirstandlast(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":348,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-28T06:51:19.000Z","updated_at":"2026-03-16T19:35:37.000Z","published_at":"2017-11-28T06:51:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。 もし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   stringfirstandlast('boring example') = 'be']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 649. Return the first and last character of a string\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/649\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/649\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44400,"title":"二つのベクトルの要素ごとの積の平均を計算しよう","description":"二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。\r\n例:\r\n 二つのベクトル [1 2 3] と [10 15 20] が与えられたとき、\r\n それぞれの要素ごとの積の平均を取ると、\r\n 解は 33.3333 となります。\r\n 途中の計算は (1*10 + 2*15 + 3*20)/3 のようになります。\r\n(英語版) Problem 106. Weighted average \u003chttps://www.mathworks.com/matlabcentral/cody/problems/106\u003e","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 173.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 86.5833px; transform-origin: 407px 86.5833px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 322px 8px; transform-origin: 322px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 9px 8px; transform-origin: 9px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e例:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 207px 8.5px; tab-size: 4; transform-origin: 207px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 53px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 53px 8.5px; \"\u003e二つのベクトル \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 32px 8.5px; transform-origin: 32px 8.5px; \"\u003e[1 2 3] \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 11px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 11px 8.5px; \"\u003eと \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 44px 8.5px; transform-origin: 44px 8.5px; \"\u003e[10 15 20] \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 63px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 63px 8.5px; \"\u003eが与えられたとき、\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 137px 8.5px; tab-size: 4; transform-origin: 137px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 133px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 133px 8.5px; \"\u003eそれぞれの要素ごとの積の平均を取ると、\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 96px 8.5px; tab-size: 4; transform-origin: 96px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 18px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 18px 8.5px; \"\u003e解は \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 32px 8.5px; transform-origin: 32px 8.5px; \"\u003e33.3333 \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 42px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 42px 8.5px; \"\u003eとなります。\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 205px 8.5px; tab-size: 4; transform-origin: 205px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 46px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 46px 8.5px; \"\u003e途中の計算は \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 92px 8.5px; transform-origin: 92px 8.5px; \"\u003e(1*10 + 2*15 + 3*20)/3 \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 63px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 63px 8.5px; \"\u003eのようになります。\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 10.2167px; transform-origin: 391px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 130px 8px; transform-origin: 130px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(英語版) Problem 106. Weighted average\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/106\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/106\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = weighted_average(x,w)\r\n  y =\r\nend","test_suite":"%%\r\nx = [1 2 3];\r\nw = [10 15 20];\r\ny_correct = 100/3;\r\nassert(isequal(weighted_average(x,w),y_correct))\r\n\r\n%%\r\nx = [3 2 1];\r\nw = [10 15 20];\r\ny_correct = 80/3;\r\nassert(isequal(weighted_average(x,w),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":6,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":426,"test_suite_updated_at":"2022-01-13T16:57:06.000Z","rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-09T04:58:13.000Z","updated_at":"2026-03-16T19:00:14.000Z","published_at":"2017-11-09T04:58:13.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 二つのベクトル [1 2 3] と [10 15 20] が与えられたとき、\\n それぞれの要素ごとの積の平均を取ると、\\n 解は 33.3333 となります。\\n 途中の計算は (1*10 + 2*15 + 3*20)/3 のようになります。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 106. Weighted average\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/106\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/106\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44551,"title":"Calcular la razón de proporcionalidad ","description":"Dadas dos magnitudes (a y b) en forma de vectores, crear una función que permita obtener la razón de proporcionalidad _*m*_ sólo en aquellos casos en los que exista una relación de proporcionalidad directa entre ambas.\r\n\r\n* *Ejemplo 1:*\r\n\r\n  a = [1 2 3 4]\r\nb = [2 4 6 8]\r\n\r\nRelación proporcional de razón m = 2.\r\n\r\n* *Ejemplo 2:* \r\n\r\n  a = [1 2 3 4]\r\n  b = [1 6 3 2]\r\n\r\nNo existe relación de proporcionalidad, por lo que m = 0.","description_html":"\u003cp\u003eDadas dos magnitudes (a y b) en forma de vectores, crear una función que permita obtener la razón de proporcionalidad \u003ci\u003e\u003cb\u003em\u003c/b\u003e\u003c/i\u003e sólo en aquellos casos en los que exista una relación de proporcionalidad directa entre ambas.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eEjemplo 1:\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cpre class=\"language-matlab\"\u003ea = [1 2 3 4]\r\nb = [2 4 6 8]\r\n\u003c/pre\u003e\u003cp\u003eRelación proporcional de razón m = 2.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eEjemplo 2:\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cpre class=\"language-matlab\"\u003ea = [1 2 3 4]\r\nb = [1 6 3 2]\r\n\u003c/pre\u003e\u003cp\u003eNo existe relación de proporcionalidad, por lo que m = 0.\u003c/p\u003e","function_template":"% Se trata de la plantilla inicial que aparecerá cuando el alumno se disponga a resolver el problema.\r\n\r\nfunction m = razon_proporcionalidad(a,b)\r\n  \r\nend","test_suite":"% Se deberá definir una serie de casos en los que comprobar el resultado obtenido por los alumnos \r\n% y el resultado correcto. De esta manera, si la respuesta al problema consigue superar todos los \r\n% test, se dará la respuesta como válida. \r\n\r\n%% TEST 1\r\na = [1 2 3 4];\r\nb = [2 4 6 8];\r\nm_correct = 2;\r\nassert(isequal(razon_proporcionalidad(a,b),m_correct))\r\n\r\n%% TEST 2\r\na = [1 2 3 4];\r\nb = [1 4 2 8];\r\nm_correct = 0;\r\nassert(isequal(razon_proporcionalidad(a,b),m_correct))\r\n\r\n%% TEST 3\r\na = [3 5 12 1.5];\r\nb = [10.5 17.5 42 5.25];\r\nm_correct = 3.5;\r\nassert(isequal(razon_proporcionalidad(a,b),m_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":132597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-11T12:21:16.000Z","updated_at":"2026-03-11T09:42:50.000Z","published_at":"2018-04-17T18:00:04.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDadas dos magnitudes (a y b) en forma de vectores, crear una función que permita obtener la razón de proporcionalidad\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e sólo en aquellos casos en los que exista una relación de proporcionalidad directa entre ambas.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo 1:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = [1 2 3 4]\\nb = [2 4 6 8]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRelación proporcional de razón m = 2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo 2:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = [1 2 3 4]\\nb = [1 6 3 2]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNo existe relación de proporcionalidad, por lo que m = 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44411,"title":"テレビのサイズを求めてみよう","description":"あなたは電気屋で働いています。\r\n\r\nあなたの電気屋にテレビを買いに来たお客さんに「何インチのテレビを買いたいのか」と質問したところ、対角線の情報しかわからないと言われてしまいました。\r\n\r\nしかし、テレビのインチを知るには、幅と高さの情報が必要です。\r\n \r\nすべてのテレビの縦横比が 9 : 16 であると仮定した上で、画面の対角線の長さを入れると画面の幅と高さの値をそれぞれ返す関数を作成してみましょう。\r\n\r\n* (英語版) Problem 43008. What's size of TV?\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43008\u003e","description_html":"\u003cp\u003eあなたは電気屋で働いています。\u003c/p\u003e\u003cp\u003eあなたの電気屋にテレビを買いに来たお客さんに「何インチのテレビを買いたいのか」と質問したところ、対角線の情報しかわからないと言われてしまいました。\u003c/p\u003e\u003cp\u003eしかし、テレビのインチを知るには、幅と高さの情報が必要です。\u003c/p\u003e\u003cp\u003eすべてのテレビの縦横比が 9 : 16 であると仮定した上で、画面の対角線の長さを入れると画面の幅と高さの値をそれぞれ返す関数を作成してみましょう。\u003c/p\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 43008. What's size of TV? \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43008\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/43008\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function [width height] = TV(x)\r\n  width =\r\n  height =\r\nend\r\n","test_suite":"%%\r\nx = 40;\r\ny_correct = [34.86 19.61];\r\n[y1 y2]=TV(x)\r\nassert(y1-y_correct(1)\u003c=0.01 \u0026\u0026 y2-y_correct(2)\u003c=0.01)\r\n \r\n%%\r\nx=49\r\ny_correct = [42.71 24.02];\r\n[y1 y2]=TV(x)\r\nassert(y1-y_correct(1)\u003c=0.01 \u0026\u0026 y2-y_correct(2)\u003c=0.01)\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":1,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":322,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-16T01:50:14.000Z","updated_at":"2026-03-16T19:30:39.000Z","published_at":"2017-11-16T01:50:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eあなたは電気屋で働いています。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eあなたの電気屋にテレビを買いに来たお客さんに「何インチのテレビを買いたいのか」と質問したところ、対角線の情報しかわからないと言われてしまいました。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eしかし、テレビのインチを知るには、幅と高さの情報が必要です。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eすべてのテレビの縦横比が 9 : 16 であると仮定した上で、画面の対角線の長さを入れると画面の幅と高さの値をそれぞれ返す関数を作成してみましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 43008. What's size of TV?\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43008\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/43008\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44612,"title":"¡Puntos de corte!","description":"Crea una función que permita calcular los puntos de corte con los ejes X e Y de una función cuadrática indicada por el usuario en base a la siguiente ecuación:\r\n\r\ny = a*x^2+b*x+c \r\n\r\nDonde el usuario introducirá los parámetros *a*, *b* y *c*\r\n\r\n* *Ejemplo*\r\n\r\nDada la función cuadrática y = -2*x^2-12*x-10, se obtiene que los puntos de corte con el eje X son P1(-5,0) y P2(-1,0), así como el punto de corte con el eje Y P3(0,-10).\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 97px; vertical-align: baseline; perspective-origin: 332px 97px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; perspective-origin: 309px 21px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCrea una función que permita calcular los puntos de corte con los ejes X e Y de una función cuadrática indicada por el usuario en base a la siguiente ecuación:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ey = a*x^2+b*x+c\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eDonde el usuario introducirá los parámetros\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003ea\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e,\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eb\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e y\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003ec\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-bottom: 20px; margin-top: 10px; transform-origin: 316px 10px; perspective-origin: 316px 10px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"display: list-item; margin-bottom: 0px; margin-left: 56px; margin-top: 0px; text-align: left; transform-origin: 288px 10px; white-space: pre-wrap; perspective-origin: 288px 10px; margin-left: 56px; \"\u003e\u003cspan style=\"display: inline; margin-left: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eEjemplo\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; perspective-origin: 309px 21px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eDada la función cuadrática y = -2*x^2-12*x-10, se obtiene que los puntos de corte con el eje X son P1(-5,0) y P2(-1,0), así como el punto de corte con el eje Y P3(0,-10).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [puntos_corte] = puntos_corte(a,b,c)\r\n  \r\nend","test_suite":"%% TEST 1\r\na = -2;\r\nb = -12;\r\nc = -10;\r\n[puntos_corte_correct] = [-5 -1 -10];\r\nassert(isequal(puntos_corte(a,b,c),puntos_corte_correct))\r\n\r\n%% TEST 2\r\na = 1;\r\nb = -3;\r\nc = -4;\r\n[puntos_corte_correct] = [-1 4 -4];\r\nassert(isequal(puntos_corte(a,b,c),puntos_corte_correct))\r\n\r\n%% TEST 3\r\na = 2;\r\nb = -2;\r\nc = -4;\r\n[puntos_corte_correct] = [-1 2 -4];\r\nassert(isequal(puntos_corte(a,b,c),puntos_corte_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":132597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":"2020-09-29T15:58:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-16T07:55:46.000Z","updated_at":"2026-01-29T15:33:54.000Z","published_at":"2018-04-17T18:00:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCrea una función que permita calcular los puntos de corte con los ejes X e Y de una función cuadrática indicada por el usuario en base a la siguiente ecuación:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = a*x^2+b*x+c\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDonde el usuario introducirá los parámetros\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e y\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDada la función cuadrática y = -2*x^2-12*x-10, se obtiene que los puntos de corte con el eje X son P1(-5,0) y P2(-1,0), así como el punto de corte con el eje Y P3(0,-10).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44417,"title":"英語の文章内の母音を取り除くコードを書きましょう。","description":"与えられた英語の文章内の母音を取り除きましょう。\r\n\r\n例:\r\n\r\n 入力 s1 が 'Jack and Jill went up the hill' の場合、\r\n 出力 s2 は 'Jck nd Jll wnt p th hll'\r\n\r\n* (英語版) Problem 22. Remove the vowels\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/22\u003e","description_html":"\u003cp\u003e与えられた英語の文章内の母音を取り除きましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e 入力 s1 が 'Jack and Jill went up the hill' の場合、\r\n 出力 s2 は 'Jck nd Jll wnt p th hll'\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 22. Remove the vowels \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/22\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/22\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function s2 = refcn(s1)\r\n    s2 = s1;\r\nend","test_suite":"%%\r\ns1 = 'Jack and Jill went up the hill'; \r\ns2 = 'Jck nd Jll wnt p th hll';\r\nassert(isequal(s2,refcn(s1)))\r\n%%\r\ns1 = 'I don''t want to work. I just want to bang on the drum all day.'; \r\ns2 = ' dn''t wnt t wrk.  jst wnt t bng n th drm ll dy.'; \r\nassert(isequal(s2,refcn(s1)))","published":true,"deleted":false,"likes_count":5,"comments_count":6,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":326,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-27T09:18:36.000Z","updated_at":"2026-03-16T19:32:28.000Z","published_at":"2017-11-27T09:18:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e与えられた英語の文章内の母音を取り除きましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 入力 s1 が 'Jack and Jill went up the hill' の場合、\\n 出力 s2 は 'Jck nd Jll wnt p th hll']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 22. Remove the vowels\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/22\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/22\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44398,"title":"ベクトルの値が増加しているかを調べよう","description":"ベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。\r\n\r\n例:\r\n\r\n   入力が  x = [-3 0 7] のとき、\r\n   関数の出力 tf は true を返します。\r\n\r\n   入力が  x = [2 2] のとき、\r\n   関数の出力 tf は false を返します。\r\n\r\n* (英語版) Problem 10. Determine whether a vector is monotonically increasing\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\u003e","description_html":"\u003cp\u003eベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e   入力が  x = [-3 0 7] のとき、\r\n   関数の出力 tf は true を返します。\u003c/pre\u003e\u003cpre\u003e   入力が  x = [2 2] のとき、\r\n   関数の出力 tf は false を返します。\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 10. Determine whether a vector is monotonically increasing \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function tf = mono_increase(x)\r\n  tf = false;\r\nend","test_suite":"%%\r\nx = [0 1 2 3 4];\r\nassert(isequal(mono_increase(x),true));\r\n%%\r\nx = [0];\r\nassert(isequal(mono_increase(x),true));\r\n%%\t\r\nx = [0 0 0 0 0];\r\nassert(isequal(mono_increase(x),false));\r\n%%\t\r\nx = [0 1 2 3 -4];\r\nassert(isequal(mono_increase(x),false));\r\n%%\t\r\nx = [-3 -4 2 3 4];\r\nassert(isequal(mono_increase(x),false));\r\n%%\r\nx = 1:.1:10;\r\nassert(isequal(mono_increase(x),true));\r\n%%\t\r\nx = cumsum(rand(1,100));\r\nx(5) = -1;\r\nassert(isequal(mono_increase(x),false));\r\n%%\t\r\nx = cumsum(rand(1,50));\r\nassert(isequal(mono_increase(x),true));","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":367,"test_suite_updated_at":"2017-11-05T23:19:13.000Z","rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-05T23:15:41.000Z","updated_at":"2026-03-17T03:46:51.000Z","published_at":"2017-11-05T23:19:13.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   入力が  x = [-3 0 7] のとき、\\n   関数の出力 tf は true を返します。\\n\\n   入力が  x = [2 2] のとき、\\n   関数の出力 tf は false を返します。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 10. Determine whether a vector is monotonically increasing\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44419,"title":"対称で、n*2n のサイズの行列を作成しましょう","description":"サイズが n*2n の \"mirror\" 行列（対称行列）を作成しましょう。\r\n \r\n例: \r\nn=2 の場合、以下のような出力を返します。\r\n\r\n  m = [ 1 2 2 1\r\n         1 2 2 1 ]\r\n\r\nn = 3 の場合、以下のようになります。\r\n\r\n m = [ 1 2 3 3 2 1\r\n       1 2 3 3 2 1\r\n       1 2 3 3 2 1 ]\r\n\r\n* (英語版) Problem 943. \"mirror\" matrix\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/943\u003e","description_html":"\u003cp\u003eサイズが n*2n の \"mirror\" 行列（対称行列）を作成しましょう。\u003c/p\u003e\u003cp\u003e例: \r\nn=2 の場合、以下のような出力を返します。\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003em = [ 1 2 2 1\r\n       1 2 2 1 ]\r\n\u003c/pre\u003e\u003cp\u003en = 3 の場合、以下のようになります。\u003c/p\u003e\u003cpre\u003e m = [ 1 2 3 3 2 1\r\n       1 2 3 3 2 1\r\n       1 2 3 3 2 1 ]\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 943. \"mirror\" matrix \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/943\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/943\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function m = mirror_matrix(n)\r\n  m = ones(n,2*n);\r\nend","test_suite":"%%\r\nn = 1;\r\nm_correct = [1 1];\r\nassert(isequal(mirror_matrix(n),m_correct))\r\n%%\r\nn = 3;\r\nm_correct = [1 2 3 3 2 1; 1 2 3 3 2 1; 1 2 3 3 2 1];\r\nassert(isequal(mirror_matrix(n),m_correct))\r\n%%\t\r\nn = 33;\r\nm_correct = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;];\r\nassert(isequal(mirror_matrix(n),m_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":319,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-28T06:44:34.000Z","updated_at":"2026-03-16T19:33:51.000Z","published_at":"2017-11-28T06:44:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eサイズが n*2n の \\\"mirror\\\" 行列（対称行列）を作成しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例: n=2 の場合、以下のような出力を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[m = [ 1 2 2 1\\n       1 2 2 1 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 3 の場合、以下のようになります。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ m = [ 1 2 3 3 2 1\\n       1 2 3 3 2 1\\n       1 2 3 3 2 1 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 943. \\\"mirror\\\" matrix\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/943\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/943\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44404,"title":"行列内の素数の平均をとろう","description":"行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。\r\n\r\n例: \r\n\r\n   入力の行列が  in = [ 8 3\r\n   　　　　　　　　　　　5 9 ]  のとき、\r\n   出力が 4 あるいは (3+5)/2 のようになります。\r\n\r\n* (英語版) Problem 14. Find the numeric mean of the prime numbers in a matrix.\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/14\u003e","description_html":"\u003cp\u003e行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e   入力の行列が  in = [ 8 3\r\n   　　　　　　　　　　　5 9 ]  のとき、\r\n   出力が 4 あるいは (3+5)/2 のようになります。\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 14. Find the numeric mean of the prime numbers in a matrix. \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/14\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/14\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function out = meanOfPrimes(in)\r\n  out = in;\r\nend","test_suite":"%%\r\nx = 3;\r\ny_correct = 3;\r\nassert(isequal(meanOfPrimes(x),y_correct))\r\n%%\r\nx = [1 2 3];\r\ny_correct = 2.5;\r\nassert(isequal(meanOfPrimes(x),y_correct))\r\n%%\r\nx = [3 3; 3 3];\r\ny_correct = 3;\r\nassert(isequal(meanOfPrimes(x),y_correct))\r\n%%\t\r\nx = [7 3 8 8]';\r\ny_correct = 5;\r\nassert(isequal(meanOfPrimes(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":351,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-14T00:15:17.000Z","updated_at":"2026-03-18T03:39:39.000Z","published_at":"2017-11-14T00:17:00.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   入力の行列が  in = [ 8 3\\n   　　　　　　　　　　　5 9 ]  のとき、\\n   出力が 4 あるいは (3+5)/2 のようになります。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 14. Find the numeric mean of the prime numbers in a matrix.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/14\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/14\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44399,"title":"二乗になっている数を見つけよう","description":"ある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。\r\n\r\n例:\r\n\r\n 入力が  a = [2 3 4] のとき、\r\n 出力 b は true になります。\r\n\r\n 2の2乗は4であり、ベクトル内に2と4の両方が含まれているため、出力は true になります。\r\n\r\n\r\n* (英語版) Problem 23. Finding Perfect Squares\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\u003e\r\n","description_html":"\u003cp\u003eある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e 入力が  a = [2 3 4] のとき、\r\n 出力 b は true になります。\u003c/pre\u003e\u003cpre\u003e 2の2乗は4であり、ベクトル内に2と4の両方が含まれているため、出力は true になります。\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 23. Finding Perfect Squares \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function b = isItSquared(a)\r\n  b = false;\r\n\r\nend","test_suite":"%%\r\na = [2 3 4];\r\nassert(isequal(isItSquared(a),true))\r\n%%\t\r\na = [20:30];\r\nassert(isequal(isItSquared(a),false))\r\n%%\r\na = [1];\r\nassert(isequal(isItSquared(a),true))\r\n%%\r\na = [6 10 12 14 36 101];\r\nassert(isequal(isItSquared(a),true))\r\n%%\t\r\na = [6 10 12 14 101];\r\nassert(isequal(isItSquared(a),false))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":346,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-07T04:42:01.000Z","updated_at":"2026-03-17T03:50:04.000Z","published_at":"2017-11-07T04:42:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 入力が  a = [2 3 4] のとき、\\n 出力 b は true になります。\\n\\n 2の2乗は4であり、ベクトル内に2と4の両方が含まれているため、出力は true になります。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 23. Finding Perfect Squares\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44541,"title":"Arrange the names in alphabetical order (2)","description":"Arrange the list of names in alphabetical order, following the German standard \u003chttps://de.wikipedia.org/wiki/Alphabetische_Sortierung#Deutschland *DIN 5007*, Variant 2, §6.1.1.4.2 — _for lists of people's names_\u003e.  \r\n\r\nSpecial characters:   \r\nä = ae,   \r\nö = oe,   \r\nü = ue,   \r\nß = ss.  \r\n\r\nThe above special characters *must* be heeded in determining the correct sequence, and retained unaltered in the final output.  Other accents would typically be ignored, but are in any case not present in the Test Suite.  Hyphens and spaces do not affect the sequence.  \r\n\r\nPrefixes:   \r\nIgnore \u003chttps://de.wikipedia.org/wiki/Namenszusatz#Ursprüngliche_Herkunftsbezeichnungen prefixes\u003e such as \"von\", \"von der\", \"vor\", \"am\", \"zum\". These can, in general, be identified in that they are *not* capitalised — _see example below_.  Capitalisation (uppercase versus lowercase) must be preserved in your final output.  \r\n\r\nSorting should be based on the _surname_ [~family name].  The surname (together with any prefixes!) will always appear _first_, followed by a comma and then the given name(s) [first name(s)].  \r\nIn principle, if two surnames were alike, then one would have to next sort by the given name(s) — however, that situation does *not* arise, and will not arise, in the Test Suite.  \r\n\r\nInputs comprise cell arrays of character vectors.  The cell arrays can be either row or column vectors.  Return your output in the same type of vector.  \r\n\r\nEXAMPLE:\r\n\r\n % Input\r\n in = {'Hofmann, Michael' \r\n       'Hölderlin, Friedrich' \r\n       'Holz, Arno'\r\n       'van Hoddis, Jakob' \r\n       'von Hofmannsthal, Hugo'}\r\n % Output\r\n out = {'van Hoddis, Jakob' \r\n       'Hölderlin, Friedrich' \r\n       'Hofmann, Michael' \r\n       'von Hofmannsthal, Hugo' \r\n       'Holz, Arno'}\r\n\r\nSee also:\r\n\r\n* \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44538 Problem 44538\u003e","description_html":"\u003cp\u003eArrange the list of names in alphabetical order, following the German standard \u003ca href = \"https://de.wikipedia.org/wiki/Alphabetische_Sortierung#Deutschland\"\u003e\u003cb\u003eDIN 5007\u003c/b\u003e, Variant 2, §6.1.1.4.2 — \u003ci\u003efor lists of people's names\u003c/i\u003e\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eSpecial characters:   \r\nä = ae,   \r\nö = oe,   \r\nü = ue,   \r\nß = ss.\u003c/p\u003e\u003cp\u003eThe above special characters \u003cb\u003emust\u003c/b\u003e be heeded in determining the correct sequence, and retained unaltered in the final output.  Other accents would typically be ignored, but are in any case not present in the Test Suite.  Hyphens and spaces do not affect the sequence.\u003c/p\u003e\u003cp\u003ePrefixes:   \r\nIgnore \u003ca href = \"https://de.wikipedia.org/wiki/Namenszusatz#Ursprüngliche_Herkunftsbezeichnungen\"\u003eprefixes\u003c/a\u003e such as \"von\", \"von der\", \"vor\", \"am\", \"zum\". These can, in general, be identified in that they are \u003cb\u003enot\u003c/b\u003e capitalised — \u003ci\u003esee example below\u003c/i\u003e.  Capitalisation (uppercase versus lowercase) must be preserved in your final output.\u003c/p\u003e\u003cp\u003eSorting should be based on the \u003ci\u003esurname\u003c/i\u003e [~family name].  The surname (together with any prefixes!) will always appear \u003ci\u003efirst\u003c/i\u003e, followed by a comma and then the given name(s) [first name(s)].  \r\nIn principle, if two surnames were alike, then one would have to next sort by the given name(s) — however, that situation does \u003cb\u003enot\u003c/b\u003e arise, and will not arise, in the Test Suite.\u003c/p\u003e\u003cp\u003eInputs comprise cell arrays of character vectors.  The cell arrays can be either row or column vectors.  Return your output in the same type of vector.\u003c/p\u003e\u003cp\u003eEXAMPLE:\u003c/p\u003e\u003cpre\u003e % Input\r\n in = {'Hofmann, Michael' \r\n       'Hölderlin, Friedrich' \r\n       'Holz, Arno'\r\n       'van Hoddis, Jakob' \r\n       'von Hofmannsthal, Hugo'}\r\n % Output\r\n out = {'van Hoddis, Jakob' \r\n       'Hölderlin, Friedrich' \r\n       'Hofmann, Michael' \r\n       'von Hofmannsthal, Hugo' \r\n       'Holz, Arno'}\u003c/pre\u003e\u003cp\u003eSee also:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44538\"\u003eProblem 44538\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"% Comments ...\r\nfunction y = meSortEm( xVector )\r\n    z = x;\r\nend","test_suite":"%% Ensure generality\r\n% Don't hardcode solutions or use test-specific lookup tables of surnames.\r\n% (Lookup tables of letters and/or prefixes are allowed, if you want, though.)\r\nRE = regexp(fileread('meSortEm.m'), '\\w+', 'match');\r\ntabooWords = {'Hölderlin' 'Friedrich' 'Holz' 'Arno' ...\r\n                'Hoffmann' 'Josef' 'Hübsch' 'Heinrich' ...\r\n                'Grass' 'Günter' 'Grünberg' 'Arnon' 'Strauch' 'Hugo' 'Strauß' 'Botho' ...\r\n                'Deutsch' 'Gerti' 'Dietrich' 'Adolf' 'Dücker' 'Eugen'};\r\ntestResult = cellfun( @(z) ismember(z, lower(tabooWords)), lower(RE) );\r\nmsg = ['Please do not hard-code your ''solution''.' char([10 13]) 'Found: ' strjoin(RE(testResult)) '.' char([10 13])];\r\nassert( ~any( testResult ), msg )\r\n\r\n\r\n%% A few authors, as in the example from the Problem Statement\r\nlist = {'van Hoddis, Jakob' \r\n       'Hölderlin, Friedrich' \r\n       'Hofmann, Michael' \r\n       'von Hofmannsthal, Hugo' \r\n       'Holz, Arno'};\r\ninput = {'Hofmann, Michael' \r\n       'Hölderlin, Friedrich' \r\n       'Holz, Arno'\r\n       'van Hoddis, Jakob' \r\n       'von Hofmannsthal, Hugo'};\r\nassert( isequal(meSortEm(input), list) )\r\n\r\n\r\n%% Architects\r\ndata = {'Auböck, Maria' 'Behnisch, Günther' 'Böhm, Elisabeth' 'van den Broek, Jo' 'van Campen, Jacob' 'Dudok, Willem Marinus' 'von Erdmannsdorff, Frederick William' 'van Eyck, Aldo' ...\r\n    'Gaddi, Taddeo' 'von Gärtner, Friedrich' 'Galilei, Alessandro' 'Gang, Jeanne' 'Gardella, Ignazio' 'Garnier, Charles' 'Gatermann, Dörte' 'Gauzin-Müller, Dominique' ...\r\n    'von Gontard, Carl' 'Höger, Fritz' 'Hoffmann, Josef' 'Hübsch, Heinrich' 'Hundertwasser, Friedensreich Regentag Dunkelbunt' 'de Key, Lieven' 'de Keyser, Hendrick' 'von Klenze, Leo' ...\r\n    'von Knobelsdorff, Georg Wenzeslaus' 'Mies, Maria Ludwig Michael' 'Mies van der Rohe, Ludwig' 'Pöppelmann, Matthäus Daniel' 'van Ravesteyn, Sybold' 'de Ridder van Groenesteyn, Stefan' 'von Ritter zu Groenesteyn, Caspar Wilhelm' 'von Ritter von Grünstein, Anselm Franz' ...\r\n    'Schneider-Esleben, Paul' 'Schütte-Lihotzky, Margarete' 'Staal-Kropholler, Margaret' 'Stowasser, Friedrich' 'van der Vlugt, Leendert' 'Wils, Jan' 'van Winden, Wilfried' 'van Zuuk, René'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 20+randi(L-20));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Authors\r\ndata = {'von Arnim, Bettina' 'Böll, Heinrich' 'Büchner, Georg' 'Busch, Wilhelm' 'von Doderer, Heimito' 'von Droste-Hülshoff, Annette' 'von Ebner-Eschenbach, Marie' 'von Eichendorff, Joseph' 'von Eschenbach, Wolfram' 'Fleißer, Marieluise' ...\r\n    'Gauß, Karl-Markus' 'Görres, Joseph' 'von Goethe, Johann Wolfgang' 'Grass, Günter' 'Grünberg, Arnon' 'Haasse, Hella' 'Härtling, Peter' 'Hamerling, Robert' 'Handke, Peter' 'von Hardenberg, Georg Philipp Friedrich' ...\r\n    'de Hartog, Jan' 'Heißenbüttel, Helmut' 'Hochhuth, Rolf' 'Hölderlin, Friedrich' 'Hoffmann, E.T.A.' 'von Hofmannsthal, Hugo' 'Jünger, Ernst' 'Kästner, Erich' 'Kaminer, Wladimir' 'Kehlmann, Daniel' ...\r\n    'von Kleist, Heinrich' 'Kofler, Werner' 'Laßwitz, Kurd' 'von Leitner, Karl Gottfried' 'Lenz, Siegfried' 'Lernet-Holenia, Alexander' 'van Loon, Hendrik Willem' 'Nöstlinger, Christine' 'Preußler, Otfried' 'von Pückler-Muskau, Hermann Ludwig Heinrich' ...\r\n    'Raabe, Wilhelm' 'Raimund, Ferdinand' 'Rühmkorf, Peter' 'Strätz, Harald' 'Strahl, Manfred' 'Stramm, August' 'von Straßburg, Gottfried' 'Strasser, Charlot' 'Stratz, Rudolph' 'Straub, Maria Elisabeth' ...\r\n    'Strauch, Hugo' 'Strauß, Botho' 'von Strauß und Torney, Luise Elisabeth' 'Suchenwirt, Peter' 'Sudermann, Hermann' 'Sülzer, Bernd' 'Süskind, Patrick' 'Süßmann, Christel' 'Süverkrüp, Dieter' 'Sula, Marianne' ...\r\n    'Sulzenbacher, Hannes' 'Sulzer, Alain Claude' 'von Suttner, Bertha' 'von Trimberg, Süßkind' 'von der Vogelweide, Walter' 'van den Vondel, Joost' 'Voß, Johann Heinrich' 'de Vries, Anne' 'von Waldenfels, Rudolf' 'Walser, Martin' ...\r\n    'von Weißenburg, Otfrid' 'van de Wetering, Janwillem' 'von Wilpert, Gero' 'von Wolkenstein, Oswald' 'von Zatzikhoven, Ulrich'};\r\ndata = data';\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 35+randi(L-35));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Artists, esp. painters (~A \u0026 D)\r\n% Amended 2018-03-11 to remove duplicate surname.  \r\ndata = {'Albers, Josef' 'Aldenrath, Heinrich Jacob' 'Alexander, William' 'Allers, Christian Wilhelm' 'Daege, Eduard' 'Dähling, Heinrich Anton' 'Dahm, Helen' 'Danckerts, Hendrick' ...\r\n    'Danioth, Heinrich' 'Dauerer, Gabriela' 'Decker, Cornelis Gerritsz' 'Degen, Paul' 'van Delen, Dirck' 'Deutsch, Gerti' 'van Diepenbeeck, Abraham' 'Diepraam, Abraham' ...\r\n    'Dietrich, Adolf' 'Dietz, Feodor' 'von Diez, Wilhelm' 'van Dijck, Floris Claesz' 'Dill, Ludwig' 'von Dillis, Johann Georg' 'Dinger, Fritz' 'Dinglinger, Georg Friedrich' ...\r\n    'Disler, Martin' 'Disteli, Martin' 'Dix, Otto' 'Doepler, Emil' 'Dörbeck, Franz Burchard' 'Doerner, Max' 'Domscheit, Franz' 'Donck, Gerard' ...\r\n    'Doomer, Lambert' 'Dou, Gerard' 'Drache, Heinz' 'Dräger, Anton Josef' 'Dreber, Heinrich' 'Dreesen, Willi' 'Droochsloot, Cornelis' ...\r\n    'Drost, Willem' 'Dryander, Johann Friedrich' 'Dubbels, Hendrick Jacobsz' 'Dubordieu, Pieter' 'Duck, Jacob' 'Dücker, Eugen' 'Dürer, Albrecht' 'Dufaux, Henri' ...\r\n    'Dujardin, Karel' 'Dunker, Balthasar Anton' 'Dusart, Cornelis' 'Duyster, Willem Cornelisz' 'Dyck, Hermann' 'Dziersk, Udo'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 25+randi(L-25));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Hyphenated names\r\n% Added 2018-03-11 to test handling of hyphenation.  \r\ndata = {'Droste, Udo' 'Droste-Doderer, Heimito' 'von Droste-Hülshoff, Gerti' 'Droste-Strauß, Annette' 'Ebner, Wolfram' 'Ebner-Eichendorff, Willem' 'von Ebner-Eschenbach, Marie' 'Ebner-Nöstlinger, Christine' 'von Gauzin, Carl' 'Gauzin-Gatermann, Dominique' ...\r\n    'van Gauzin-Gontard, Dörte' 'Gauzin-Müller, Anton' 'Lernet, Hermann' 'Lernet-Holenia, Willem' 'Lernet-Loon, Hendrik' 'van Lernet-Süßmann, Christel' 'Pückler, Ludwig' 'Pückler-Dauerer, Gabriela' 'von Pückler-Muskau, Otfried' 'Pückler-Preußler, Heinrich'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 10+randi(L-10));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":"2018-03-11T05:39:54.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2018-03-10T03:11:08.000Z","updated_at":"2018-03-11T05:39:54.000Z","published_at":"2018-03-10T05:27:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eArrange the list of names in alphabetical order, following the German standard\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Alphabetische_Sortierung#Deutschland\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDIN 5007\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, Variant 2, §6.1.1.4.2 —\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efor lists of people's names\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSpecial characters:    ä = ae,    ö = oe,    ü = ue,    ß = ss.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe above special characters\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emust\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be heeded in determining the correct sequence, and retained unaltered in the final output. Other accents would typically be ignored, but are in any case not present in the Test Suite. Hyphens and spaces do not affect the sequence.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePrefixes:    Ignore\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Namenszusatz#Ursprüngliche_Herkunftsbezeichnungen\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eprefixes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e such as \\\"von\\\", \\\"von der\\\", \\\"vor\\\", \\\"am\\\", \\\"zum\\\". These can, in general, be identified in that they are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e capitalised —\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esee example below\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Capitalisation (uppercase versus lowercase) must be preserved in your final output.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSorting should be based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esurname\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [~family name]. The surname (together with any prefixes!) will always appear\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efirst\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, followed by a comma and then the given name(s) [first name(s)]. In principle, if two surnames were alike, then one would have to next sort by the given name(s) — however, that situation does\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e arise, and will not arise, in the Test Suite.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ % Input\\n in = {'Hofmann, Michael' \\n       'Hölderlin, Friedrich' \\n       'Holz, Arno'\\n       'van Hoddis, Jakob' \\n       'von Hofmannsthal, Hugo'}\\n % Output\\n out = {'van Hoddis, Jakob' \\n       'Hölderlin, Friedrich' \\n       'Hofmann, Michael' \\n       'von Hofmannsthal, Hugo' \\n       'Holz, Arno'}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee also:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44538\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44538\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44410,"title":"NaN (欠損値) が含まれている行を削除しよう","description":"行列 A が与えられたとき、その行列の中に NaN (Not a number; 欠損値) の要素がある行を見つけ出し、その行を削除しましょう。\r\n\r\n例: \r\n\r\n A = [  1   5   8 \r\n       -3 NaN  14 \r\n        0   6 NaN ];\r\n\r\nの行列が与えられたとき、関数は以下のようなベクトル B を返します。\r\n\r\n B = [  1   5   8 ]\r\n\r\n* (英語版) Problem 25. Remove any row in which a NaN appears\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/25\u003e","description_html":"\u003cp\u003e行列 A が与えられたとき、その行列の中に NaN (Not a number; 欠損値) の要素がある行を見つけ出し、その行を削除しましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e A = [  1   5   8 \r\n       -3 NaN  14 \r\n        0   6 NaN ];\u003c/pre\u003e\u003cp\u003eの行列が与えられたとき、関数は以下のようなベクトル B を返します。\u003c/p\u003e\u003cpre\u003e B = [  1   5   8 ]\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 25. Remove any row in which a NaN appears \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/25\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/25\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function B = remove_nan_rows(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [  1   5   8 \r\n       -3 NaN  14 \r\n        0   6 NaN ];\r\nB_correct = [  1   5   8 ];\r\nassert(isequal(remove_nan_rows(A),B_correct))\r\n\r\n%%\r\nA = 1:10;\r\nB_correct = A;\r\nassert(isequal(remove_nan_rows(A),B_correct))\r\n\r\n%%\r\n \r\nA = [   1   5   8 \r\n       -3 NaN  14 \r\n        0   6   6];\r\nB_correct = [1 5 8; 0 6 6];\r\nassert(isequal(remove_nan_rows(A),B_correct))\r\n\r\n%%\r\nA = [ 1 3 6 NaN 3 NaN]';\r\nB_correct = [1 3 6 3]';\r\nassert(isequal(remove_nan_rows(A),B_correct))\r\n\r\n%%\r\nA = [ 1 3 6 NaN;\r\n      3 4 2  1];\r\nB_correct = [3 4 2 1];\r\nassert(isequal(remove_nan_rows(A),B_correct))","published":true,"deleted":false,"likes_count":9,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":339,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-16T01:31:51.000Z","updated_at":"2026-03-16T19:23:16.000Z","published_at":"2017-11-16T01:32:05.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e行列 A が与えられたとき、その行列の中に NaN (Not a number; 欠損値) の要素がある行を見つけ出し、その行を削除しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ A = [  1   5   8 \\n       -3 NaN  14 \\n        0   6 NaN ];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eの行列が与えられたとき、関数は以下のようなベクトル B を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ B = [  1   5   8 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 25. Remove any row in which a NaN appears\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/25\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/25\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44408,"title":"ゼロでない要素が一番多い行を探そう","description":"行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。\r\n\r\n例:\r\n\r\n 入力として、行列  \r\n a = [ 1 2 0 0 0\r\n       0 0 5 0 0 \r\n       2 7 0 0 0\r\n       0 6 9 3 3 ]\r\n が与えられたとき、出力 r は 4 を返します。\r\n\r\n* (英語版) Problem 32. Most nonzero elements in row\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/32\u003e","description_html":"\u003cp\u003e行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e 入力として、行列  \r\n a = [ 1 2 0 0 0\r\n       0 0 5 0 0 \r\n       2 7 0 0 0\r\n       0 6 9 3 3 ]\r\n が与えられたとき、出力 r は 4 を返します。\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 32. Most nonzero elements in row \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/32\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/32\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function r = fullest_row(a)\r\n  r = 1\r\nend","test_suite":"%%\r\na = [ ...\r\n 1 2 0 0 0\r\n 0 0 5 0 0 \r\n 2 7 0 0 0\r\n 0 6 9 3 3];\r\nr_correct = 4;\r\nassert(isequal(fullest_row(a),r_correct))\r\n\r\n%%\r\na = [ ...\r\n1 2 0 0 \r\n 0 0 5 0  \r\n 0 6 9 -3\r\n 2 7 0 0 \r\n 0 0 0 0];\r\nr_correct = 3;\r\nassert(isequal(fullest_row(a),r_correct))\r\n%%\r\na = [ ...\r\n 1 0 0 \r\n 0 0 0  \r\n 0 0 0\r\n 0 0 0 \r\n 0 2 3];\r\nr_correct = 5;\r\nassert(isequal(fullest_row(a),r_correct))\r\n%%\r\na = [ ...\r\n 0 \r\n 0  \r\n 0\r\n -3\r\n 0 \r\n 0];\r\nr_correct = 4;\r\nassert(isequal(fullest_row(a),r_correct))","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":345,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-14T23:35:31.000Z","updated_at":"2026-03-18T03:46:35.000Z","published_at":"2017-11-14T23:35:31.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 入力として、行列  \\n a = [ 1 2 0 0 0\\n       0 0 5 0 0 \\n       2 7 0 0 0\\n       0 6 9 3 3 ]\\n が与えられたとき、出力 r は 4 を返します。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 32. Most nonzero elements in row\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/32\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/32\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44840,"title":"Cody Problems in French : Trouvez la logique Pt.1","description":"On rentre x = 4\r\net il en sort y = 160.\r\nTrouvez la logique entre x et y, aidez-vous de la test suite.\r\nBon courage. \r\n\r\nP.S: L'utilisation de \"^\" est fortement conseillée","description_html":"\u003cp\u003eOn rentre x = 4\r\net il en sort y = 160.\r\nTrouvez la logique entre x et y, aidez-vous de la test suite.\r\nBon courage.\u003c/p\u003e\u003cp\u003eP.S: L'utilisation de \"^\" est fortement conseillée\u003c/p\u003e","function_template":"function y = logic(x)\r\n  y = x;\r\nend","test_suite":"filetext = fileread('logic.m')\r\nassert(isempty(strfind(filetext, 'regexp')),'regexp interdit')\r\nassert(isempty(strfind(filetext, 'assert')),'assert interdit')\r\n\r\n%%\r\nx = 0;\r\ny_correct = 0;\r\nassert(isequal(logic(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 8;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 39;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 7;\r\ny_correct = 7651;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 12;\r\ny_correct = 3188640;\r\nassert(isequal(logic(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":280631,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":21,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-01-28T12:54:11.000Z","updated_at":"2026-01-21T13:46:49.000Z","published_at":"2019-01-28T12:54:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOn rentre x = 4 et il en sort y = 160. Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eP.S: L'utilisation de \\\"^\\\" est fortement conseillée\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44538,"title":"Arrange the names in alphabetical order (1)","description":"Arrange the list of names in alphabetical order. The original 'alphabetical order', that is: from α and β all the way through to ω. We might call this 'alpha-beta-cal order'!\r\nYou do not need to heed the capitalisation (uppercase versus lowercase) in determining the correct sequence, although it must be preserved in your final output.\r\nAccents or diacritics should not be heeded in determining the correct sequence, but should likewise be retained in the final output. This is consistent with some practice, albeit not universal. Only the 'tonos' will be present in the Test Suite (unless you try the optional Bonus Question).\r\nSorting should be based on the surname [family name], where present. The surname will always appear last, if present. In principle, if two surnames were alike, then one would have to next sort by the given name(s) [first name(s)] — however, that situation does not arise, and will not arise, in the Test Suite.\r\nInputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.\r\nEXAMPLE:\r\n % Input\r\n in = {'Δημήτρης Δραγατάκης'; 'Ρίτα Αμπατζή'}\r\n % Output\r\n out = {'Ρίτα Αμπατζή'; 'Δημήτρης Δραγατάκης'}\r\nAlthough Δ (delta, ~d) precedes Ρ (rho, ~r) in the Greek alphabet, we must sort first by surname, for which Α (alpha, ~a) precedes Δ (delta, ~d).\r\nSee also:\r\nProblem 44541","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 543.188px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 333px 271.587px; transform-origin: 333px 271.594px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 21px; text-align: left; transform-origin: 310px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eArrange the list of names in alphabetical order. The\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eoriginal\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e 'alphabetical order', that is: from α and β all the way through to ω. We might call this\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e'alpha-beta-cal order'\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 21px; text-align: left; transform-origin: 310px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou do\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003enot\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e need to heed the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ecapitalisation\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (uppercase versus lowercase) in determining the correct sequence, although it must be preserved in your final output.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 31.5px; text-align: left; transform-origin: 310px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eAccents\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e or diacritics should\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003enot\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e be heeded in determining the correct sequence, but should likewise be retained in the final output. This is consistent with\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/List_of_Greek_place_names\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003esome practice\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, albeit\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.tlg.uci.edu/help/Doc002.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003enot universal\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Only the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003e'tonos'\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e will be present in the Test Suite (unless you try the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eoptional\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Bonus Question).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 42px; text-align: left; transform-origin: 310px 42px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSorting should be based on the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003esurname\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e [family name], where present. The surname will always appear\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003elast\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, if present. In principle, if two surnames were alike, then one would have to next sort by the given name(s) [first name(s)] — however, that situation does\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003enot\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e arise, and will not arise, in the Test Suite.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 21px; text-align: left; transform-origin: 310px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eInputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 10.5px; text-align: left; transform-origin: 310px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEXAMPLE:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.75px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 330px 40.875px; transform-origin: 330px 40.875px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 330px 10.2125px; text-wrap-mode: nowrap; transform-origin: 330px 10.2188px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(2, 128, 9); border-block-start-color: rgb(2, 128, 9); border-bottom-color: rgb(2, 128, 9); border-inline-end-color: rgb(2, 128, 9); border-inline-start-color: rgb(2, 128, 9); border-left-color: rgb(2, 128, 9); border-right-color: rgb(2, 128, 9); border-top-color: rgb(2, 128, 9); caret-color: rgb(2, 128, 9); color: rgb(2, 128, 9); column-rule-color: rgb(2, 128, 9); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(2, 128, 9); text-decoration: none; text-decoration-color: rgb(2, 128, 9); text-emphasis-color: rgb(2, 128, 9); \"\u003e% Input\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 330px 10.2125px; text-wrap-mode: nowrap; transform-origin: 330px 10.2188px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e in = {\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); \"\u003e'Δημήτρης Δραγατάκης'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e; \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); \"\u003e'Ρίτα Αμπατζή'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e}\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 330px 10.2125px; text-wrap-mode: nowrap; transform-origin: 330px 10.2188px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(2, 128, 9); border-block-start-color: rgb(2, 128, 9); border-bottom-color: rgb(2, 128, 9); border-inline-end-color: rgb(2, 128, 9); border-inline-start-color: rgb(2, 128, 9); border-left-color: rgb(2, 128, 9); border-right-color: rgb(2, 128, 9); border-top-color: rgb(2, 128, 9); caret-color: rgb(2, 128, 9); color: rgb(2, 128, 9); column-rule-color: rgb(2, 128, 9); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(2, 128, 9); text-decoration: none; text-decoration-color: rgb(2, 128, 9); text-emphasis-color: rgb(2, 128, 9); \"\u003e% Output\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 330px 10.2125px; text-wrap-mode: nowrap; transform-origin: 330px 10.2188px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e out = {\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); \"\u003e'Ρίτα Αμπατζή'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e; \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); \"\u003e'Δημήτρης Δραγατάκης'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e}\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 310px 21px; text-align: left; transform-origin: 310px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAlthough Δ (delta, ~d) precedes Ρ (rho, ~r) in the Greek alphabet, we must sort first by surname, for which Α (alpha, ~a) precedes Δ (delta, ~d).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 10.5px; text-align: left; transform-origin: 310px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSee also:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4375px; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 317px 10.2125px; transform-origin: 317px 10.2188px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 289px 10.2125px; text-align: left; transform-origin: 289px 10.2188px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/44541\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 44541\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"% Comments ...\r\nfunction y = meSortEm( xVector )\r\n    z = x;\r\nend","test_suite":"%% Ensure generality\r\n% Don't hardcode solutions or use test-specific lookup tables.\r\n% (Lookup tables of letters are allowed, if you want, though.)\r\nRE = regexp(fileread('meSortEm.m'), '\\w+', 'match');\r\ntabooWords = {'Ἄρειος' 'Ἀριστοφάνης' 'Μαρία' 'Κάλλας' 'Φώτης' 'Καφάτος' ...\r\n        'Χρήστος' 'Δάντης' 'Διονύσιος' 'Δεμέτης' 'Γρηγόρης' 'Μπιθικώτσης' ...\r\n        'Αρετή' 'Κετιμέ' 'Παναγιώτης' 'Κόκορας' 'Ιάκωβος' 'Κολανιάν' ...\r\n        'Μαρινέλλα' 'Κώστας' 'Μουντάκης' 'Ζωρζ' 'Μουστακί'};\r\ntestResult = cellfun( @(z) ismember(z, lower(tabooWords)), lower(RE) );\r\nmsg = ['Please do not hard-code your ''solution''.' char([10 13]) 'Found: ' strjoin(RE(testResult)) '.' char([10 13])];\r\nassert(~any(  cellfun( @(z) ismember(z, lower(tabooWords)), lower(RE) )  ), msg)\r\n\r\n\r\n%% Ancient Greeks\r\n% BONUS QUESTION\r\n% More difficult due to the variety of diacritics present.\r\n% (For credit — or κῦδος — not for points.)\r\ndata = {'Αἰδεσία' 'Αἰνησίδημος' 'Αἰσάρα' 'Ἄρειος' 'Ἀριστοφάνης' ...\r\n        'Ἀριστοφῶν' 'Ἀριστώνυμος' 'Ἀσκληπιόδοτος'};\r\nL = length(data);\r\npassedTheBonusQuestion = true;\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    if ~isequal(meSortEm(input), list),\r\n        passedTheBonusQuestion = false;\r\n        disp('.')\r\n        disp('You have NOT solved the optional Bonus Question.')\r\n        disp('But you can still pass the Test Suite.')\r\n        return;\r\n    end;\r\n    %assert( isequal(meSortEm(input), list) )\r\nend;\r\ndisp('.')\r\ndisp('Congratulations:  you''ve solved the optional Bonus Question.')\r\n\r\n\r\n%% Various occupations\r\ndata = {'Γιάννα Αγγελοπούλου-Δασκαλάκη'\r\n'Οδυσσέας Αλεπουδέλλης'\r\n'Δημήτρης Βάρος'\r\n'Κική Δημουλά'\r\n'Οδυσσέας Ελύτης'\r\n'Αλέξανδρος Αρνόλδος Κωνσταντίνος Ισηγόνης'\r\n'Μαρία Κάλλας'\r\n'Κωνσταντίνος Καραθεοδωρή'\r\n'Φώτης Κ. Καφάτος'\r\n'Δημήτριος Κουκούζης'\r\n'Σπυρίδων Νικολάου Μαρινάτος'\r\n'Ντούλα Μουρίκη'\r\n'Ευστράτιος Ντελάρωφ'\r\n'Ἰωάννης Φωκᾶς'\r\n'Δημήτριος Χριστοδούλου'\r\n'Αριστοτέλης Ωνάσης'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Musicians:  A to ~G\r\ndata = {'Ρίτα Αμπατζή' 'Κώστας Ανδρέου' 'Θεόδωρος Αντωνίου' 'Γρηγόρης Ασίκης' ...\r\n        'Νικόλας Άσιμος' 'Χρήστος Δάντης' 'Διονύσιος Δεμέτης' 'Δημήτρης Δραγατάκης' ...\r\n        'Αντίοχος Ευαγγελάτος' 'Κωνσταντίνος Καραμητρούδης' 'Παύλος Καρρέρ' 'Μιλτιάδης Καρύδης' ...\r\n        'Γιώργος Μπάτης' 'Τζίνα Μπαχάουερ' 'Γρηγόρης Μπιθικώτσης' 'Μαρία Φαραντούρη' ...\r\n        'Γιάννης Χρήστου' 'Πέτρος Χριστοδουλίδης'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n%% Musicians:  ~G to K\r\ndata = {'Κατερίνα Γαρμπή'\r\n'Μιχάλης Γενίτσαρης'\r\n'Αλκίνοος Ιωαννίδης'\r\n'Λεωνίδας Καβάκος'\r\n'Στέλιος Καζαντζίδης'\r\n'Σωτήρης Κακίσης'\r\n'Μανώλης Καλομοίρης'\r\n'Ιάκωβος Καμπανέλλης'\r\n'Ελένη Καραΐνδρου'\r\n'Νίκος Καρβέλας'\r\n'Αντώνιος Κατινάρης'\r\n'Μπάμπης Κατσιώνης'\r\n'Άκης Κατσουπάκης'\r\n'Αρετή Κετιμέ'\r\n'Παναγιώτης Κόκορας'\r\n'Ιάκωβος Κολανιάν'\r\n'Σταύρος Κουγιουμτζής'\r\n'Μάνος Χατζιδάκις'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Musicians:  L to ~M\r\ndata = {'Μάνος Λοΐζος' 'Σωκράτης Μάλαμας' 'Νικόλαος Χαλικιόπουλος Μάντζαρος' ...\r\n    'Μαρινέλλα' 'Γιάννης Μαρκόπουλος' 'Κώστας Μαρτάκης' ...\r\n    'Δημήτρης Μητροπάνος' 'Δημήτρης Μητρόπουλος' 'Αθανάσιος Μικρούτσικος' ...\r\n    'Κώστας Μουντάκης' 'Ζωρζ Μουστακί' 'Οριάνθη Παναγάρη' ...\r\n    'Γεώργιος Kυριάκος Παναγιώτου' 'Δημήτρης Πανούσης' 'Βασιλική Παπαδημητρίου' ...\r\n    'Λευτέρης Παπαδόπουλος' 'Λέανδρος Παπαθανασίου' 'Αθανάσιος Παπακωνσταντίνου' ...\r\n    'Έλενα Παπαρίζου'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":64439,"edited_by":64439,"edited_at":"2025-09-14T15:36:24.000Z","deleted_by":null,"deleted_at":null,"solvers_count":9,"test_suite_updated_at":"2025-09-14T15:36:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-03-09T04:20:18.000Z","updated_at":"2025-09-15T19:47:16.000Z","published_at":"2018-03-09T10:22:08.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eArrange the list of names in alphabetical order. The\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eoriginal\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 'alphabetical order', that is: from α and β all the way through to ω. We might call this\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e'alpha-beta-cal order'\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou do\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e need to heed the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecapitalisation\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (uppercase versus lowercase) in determining the correct sequence, although it must be preserved in your final output.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eAccents\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or diacritics should\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be heeded in determining the correct sequence, but should likewise be retained in the final output. This is consistent with\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/List_of_Greek_place_names\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esome practice\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, albeit\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.tlg.uci.edu/help/Doc002.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003enot universal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Only the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e'tonos'\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e will be present in the Test Suite (unless you try the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eoptional\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Bonus Question).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSorting should be based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esurname\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [family name], where present. The surname will always appear\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003elast\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, if present. In principle, if two surnames were alike, then one would have to next sort by the given name(s) [first name(s)] — however, that situation does\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e arise, and will not arise, in the Test Suite.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ % Input\\n in = {'Δημήτρης Δραγατάκης'; 'Ρίτα Αμπατζή'}\\n % Output\\n out = {'Ρίτα Αμπατζή'; 'Δημήτρης Δραγατάκης'}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAlthough Δ (delta, ~d) precedes Ρ (rho, ~r) in the Greek alphabet, we must sort first by surname, for which Α (alpha, ~a) precedes Δ (delta, ~d).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee also:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44541\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44541\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":44611,"title":"¡Busca el extremo!","description":"Crea una función que calcule el extremo de una parábola (máximo o mínimo absoluto) cuyos datos son proporcionados por el usuario en base a la siguiente ecuación. \r\n\r\ny = a*x^2+b\r\n\r\nEl usuario indicará los valores de *a* y *b* mientras que los valores de *x* se encontrarán en todos los casos entre -10 y +10. Se debe redondear la respuesta al número entero más cercano.\r\n\r\n* *Ejemplo*\r\n\r\nEl mínimo absoluto de la parábola y = x^2-5 es P(0,-5).","description_html":"\u003cp\u003eCrea una función que calcule el extremo de una parábola (máximo o mínimo absoluto) cuyos datos son proporcionados por el usuario en base a la siguiente ecuación.\u003c/p\u003e\u003cp\u003ey = a*x^2+b\u003c/p\u003e\u003cp\u003eEl usuario indicará los valores de \u003cb\u003ea\u003c/b\u003e y \u003cb\u003eb\u003c/b\u003e mientras que los valores de \u003cb\u003ex\u003c/b\u003e se encontrarán en todos los casos entre -10 y +10. Se debe redondear la respuesta al número entero más cercano.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eEjemplo\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eEl mínimo absoluto de la parábola y = x^2-5 es P(0,-5).\u003c/p\u003e","function_template":"function y = calculo_maxmin(a,b)\r\n  \r\nend","test_suite":"%% TEST 1\r\na = 2;\r\nb = -8;\r\nmin_correct = -8;\r\nassert(isequal(calculo_maxmin(a,b),min_correct))\r\n\r\n%% TEST 2 \r\na = -2;\r\nb = -8;\r\nmin_correct = -8;\r\nassert(isequal(calculo_maxmin(a,b),min_correct))\r\n\r\n%% TEST 3\r\na = -5;\r\nb = 0;\r\nmin_correct = 0;\r\nassert(isequal(calculo_maxmin(a,b),min_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":132597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-16T07:17:45.000Z","updated_at":"2026-04-08T12:50:35.000Z","published_at":"2018-04-17T18:00:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCrea una función que calcule el extremo de una parábola (máximo o mínimo absoluto) cuyos datos son proporcionados por el usuario en base a la siguiente ecuación.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = a*x^2+b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEl usuario indicará los valores de\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e y\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mientras que los valores de\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e se encontrarán en todos los casos entre -10 y +10. Se debe redondear la respuesta al número entero más cercano.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEl mínimo absoluto de la parábola y = x^2-5 es P(0,-5).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44841,"title":"Cody problems in French : Trouvez la logique Pt.2","description":"Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage.\r\n\r\nP.S: L'utilisation de \"^\" est de nouveau fortement conseillée","description_html":"\u003cp\u003eTrouvez la logique entre x et y, aidez-vous de la test suite. Bon courage.\u003c/p\u003e\u003cp\u003eP.S: L'utilisation de \"^\" est de nouveau fortement conseillée\u003c/p\u003e","function_template":"function y = logic2(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(logic2(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 512;\r\nassert(isequal(logic2(x),y_correct))\r\n%%\r\nx = 0;\r\ny_correct = 0;\r\nassert(isequal(logic2(x),y_correct))\r\n%%\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":280631,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-01-28T14:29:40.000Z","updated_at":"2026-02-06T09:41:48.000Z","published_at":"2019-01-28T14:29:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTrouvez la logique entre x et y, aidez-vous de la test suite. Bon courage.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eP.S: L'utilisation de \\\"^\\\" est de nouveau fortement conseillée\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44615,"title":"¿Es una función exponencial?","description":"Crea una función que permita analizar si los datos dados por el usuario ( *x* e *y*) se relacionan por medio de una función exponencial de la forma y = e^x. Para la comprobación redondea al primer decimal más cercano.\r\n\r\n* *Ejemplo*\r\n\r\nx = [1 2 3 4 5 6 7 8 9 10]\r\ny = [1\t2,7 7,4\t20,1 54,6 148,4\t403,4 1096,6 2981 8103,1 22026,5]\r\n\r\n*Sí* es una relación exponencial, por lo que la respuesta de la función creada será un 1 lógico.","description_html":"\u003cp\u003eCrea una función que permita analizar si los datos dados por el usuario ( \u003cb\u003ex\u003c/b\u003e e \u003cb\u003ey\u003c/b\u003e) se relacionan por medio de una función exponencial de la forma y = e^x. Para la comprobación redondea al primer decimal más cercano.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eEjemplo\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003ex = [1 2 3 4 5 6 7 8 9 10]\r\ny = [1\t2,7 7,4\t20,1 54,6 148,4\t403,4 1096,6 2981 8103,1 22026,5]\u003c/p\u003e\u003cp\u003e\u003cb\u003eSí\u003c/b\u003e es una relación exponencial, por lo que la respuesta de la función creada será un 1 lógico.\u003c/p\u003e","function_template":"function respuesta = comprobacion_exp(x,y)\r\n  \r\nend","test_suite":"%% TEST 1\r\nx = 0:1:10;\r\ny = [1 2.7 7.4 20.1 54.6 148.4 403.4 1096.6 2981 8103.1 22026.5];\r\nrespuesta_correcta = logical(1);\r\nassert(isequal(comprobacion_exp(x,y),respuesta_correcta))\r\n\r\n%% TEST 2\r\nx = 10:1:20;\r\ny = [22026.5 59874.1 162754.8 442413.4 1202604.3 3269017.4 8886110.5 24154952.8 65659969.1 178482301 485165195.4];\r\nrespuesta_correcta = logical(1);\r\nassert(isequal(comprobacion_exp(x,y),respuesta_correcta))\r\n\r\n%% TEST 3\r\nx = 10:1:20;\r\ny = [22026.5 59876.1 162754.8 442413.4 1202604.3 3269017.4 8886110.5 24154952.8 65659969.1 178482301 485165195.4];\r\nrespuesta_correcta = logical(0);\r\nassert(isequal(comprobacion_exp(x,y),respuesta_correcta))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":132597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":28,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-17T07:29:25.000Z","updated_at":"2026-03-05T15:53:44.000Z","published_at":"2018-04-17T17:57:57.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCrea una función que permita analizar si los datos dados por el usuario (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e) se relacionan por medio de una función exponencial de la forma y = e^x. Para la comprobación redondea al primer decimal más cercano.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex = [1 2 3 4 5 6 7 8 9 10] y = [1 2,7 7,4 20,1 54,6 148,4 403,4 1096,6 2981 8103,1 22026,5]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSí\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e es una relación exponencial, por lo que la respuesta de la función creada será un 1 lógico.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44409,"title":"特定の値がベクトル内に含まれているかを確認するコードを書こう","description":"ベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。\r\n\r\n例: \r\n\r\n  a = 3;\r\n  b = [1,2,4];\r\n\r\nスカラ値 3 はベクトル b に含まれていないので、関数は 0 を返します。 \r\n\r\n  a = 3;\r\n  b = [1,2,3];\r\n\r\nスカラ値 3 はベクトル b に含まれているので、関数は 1 を返します。\r\n\r\n* (英語版) Problem 838. Check if number exists in vector\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/838\u003e","description_html":"\u003cp\u003eベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = 3;\r\nb = [1,2,4];\r\n\u003c/pre\u003e\u003cp\u003eスカラ値 3 はベクトル b に含まれていないので、関数は 0 を返します。\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea = 3;\r\nb = [1,2,3];\r\n\u003c/pre\u003e\u003cp\u003eスカラ値 3 はベクトル b に含まれているので、関数は 1 を返します。\u003c/p\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 838. Check if number exists in vector \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/838\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/838\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = existsInVector(a,b)\r\n  y = [a,b];\r\nend","test_suite":"%%\r\na = 1;\r\nb = [1,2];\r\ny_correct = 1;\r\nassert(isequal(existsInVector(a,b),y_correct))\r\n%%\r\na = 12;\r\nb = [1,3,4,5,6,7,8,1,2];\r\ny_correct = 0;\r\nassert(isequal(existsInVector(a,b),y_correct))\r\n%%\r\na = -1;\r\nb = [1,2];\r\ny_correct = 0;\r\nassert(isequal(existsInVector(a,b),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":342,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-16T01:23:39.000Z","updated_at":"2026-03-16T19:21:59.000Z","published_at":"2017-11-16T01:23:39.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = 3;\\nb = [1,2,4];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eスカラ値 3 はベクトル b に含まれていないので、関数は 0 を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = 3;\\nb = [1,2,3];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eスカラ値 3 はベクトル b に含まれているので、関数は 1 を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 838. Check if number exists in vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/838\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/838\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":2289,"title":"サイコロを作ろう","description":"1から6までの独立かつランダムな数値を返すような関数を作成しましょう。\r\n\r\n例：\r\n\r\n  \u003e\u003e [x1,x2] = rollDice();\r\n\r\nと入力すると\r\n\r\n  x1 = 5\r\n  x2 = 2\r\n\r\nのような解を返します。","description_html":"\u003cp\u003e1から6までの独立かつランダムな数値を返すような関数を作成しましょう。\u003c/p\u003e\u003cp\u003e例：\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e\u0026gt;\u0026gt; [x1,x2] = rollDice();\r\n\u003c/pre\u003e\u003cp\u003eと入力すると\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex1 = 5\r\nx2 = 2\r\n\u003c/pre\u003e\u003cp\u003eのような解を返します。\u003c/p\u003e","function_template":"function [x1 x2] = rollDice(x)\r\n  x1 = x;\r\n  x2 = x;\r\nend","test_suite":"%%\r\nx1 = zeros(1,6000);\r\nx2 = zeros(1,6000);\r\nfor ii = 1:6000\r\n    [x1(ii),x2(ii)] = rollDice();\r\nend\r\nnumCt = sum( bsxfun( @eq, x1, (1:6)' ), 2 ) + sum( bsxfun( @eq, x2, (1:6)' ), 2 );\r\nassert(all(round(numCt/200) == 10) \u0026\u0026 sum(numCt) == 12000)","published":true,"deleted":false,"likes_count":6,"comments_count":4,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":404,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2014-04-16T07:43:57.000Z","updated_at":"2026-03-16T19:03:50.000Z","published_at":"2014-04-16T07:48:39.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1から6までの独立かつランダムな数値を返すような関数を作成しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例：\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[\u003e\u003e [x1,x2] = rollDice();]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eと入力すると\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x1 = 5\\nx2 = 2]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eのような解を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44420,"title":"文字列の最初と最後の文字だけ抜き出しましょう。","description":"文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。\r\nもし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\r\n\r\n例:\r\n\r\n   stringfirstandlast('boring example') = 'be'\r\n\r\n* (英語版) Problem 649. Return the first and last character of a string\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/649\u003e\r\n","description_html":"\u003cp\u003e文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。\r\nもし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e   stringfirstandlast('boring example') = 'be'\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 649. Return the first and last character of a string \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/649\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/649\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = stringfirstandlast(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'abcde';\r\ny_correct = 'ae';\r\nassert(isequal(stringfirstandlast(x),y_correct))\r\n%%\t\r\nx = 'a';\r\ny_correct = 'aa';\r\nassert(isequal(stringfirstandlast(x),y_correct))\r\n%%\t\r\nx = 'codyrocks!';\r\ny_correct = 'c!';\r\nassert(isequal(stringfirstandlast(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":348,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-28T06:51:19.000Z","updated_at":"2026-03-16T19:35:37.000Z","published_at":"2017-11-28T06:51:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。 もし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   stringfirstandlast('boring example') = 'be']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 649. Return the first and last character of a string\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/649\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/649\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44400,"title":"二つのベクトルの要素ごとの積の平均を計算しよう","description":"二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。\r\n例:\r\n 二つのベクトル [1 2 3] と [10 15 20] が与えられたとき、\r\n それぞれの要素ごとの積の平均を取ると、\r\n 解は 33.3333 となります。\r\n 途中の計算は (1*10 + 2*15 + 3*20)/3 のようになります。\r\n(英語版) Problem 106. Weighted average \u003chttps://www.mathworks.com/matlabcentral/cody/problems/106\u003e","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 173.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 86.5833px; transform-origin: 407px 86.5833px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 322px 8px; transform-origin: 322px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 9px 8px; transform-origin: 9px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e例:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 40.8667px; transform-origin: 404px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 207px 8.5px; tab-size: 4; transform-origin: 207px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 53px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 53px 8.5px; \"\u003e二つのベクトル \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 32px 8.5px; transform-origin: 32px 8.5px; \"\u003e[1 2 3] \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 11px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 11px 8.5px; \"\u003eと \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 44px 8.5px; transform-origin: 44px 8.5px; \"\u003e[10 15 20] \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 63px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 63px 8.5px; \"\u003eが与えられたとき、\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 137px 8.5px; tab-size: 4; transform-origin: 137px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 133px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 133px 8.5px; \"\u003eそれぞれの要素ごとの積の平均を取ると、\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 96px 8.5px; tab-size: 4; transform-origin: 96px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 18px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 18px 8.5px; \"\u003e解は \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 32px 8.5px; transform-origin: 32px 8.5px; \"\u003e33.3333 \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 42px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 42px 8.5px; \"\u003eとなります。\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 205px 8.5px; tab-size: 4; transform-origin: 205px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 46px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 46px 8.5px; \"\u003e途中の計算は \u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 92px 8.5px; transform-origin: 92px 8.5px; \"\u003e(1*10 + 2*15 + 3*20)/3 \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 63px 8.5px; text-decoration: none; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 63px 8.5px; \"\u003eのようになります。\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4333px; counter-reset: list-item 0; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 391px 10.2167px; transform-origin: 391px 10.2167px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"counter-reset: none; display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 363px 10.2167px; text-align: left; transform-origin: 363px 10.2167px; white-space: pre-wrap; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 130px 8px; transform-origin: 130px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(英語版) Problem 106. Weighted average\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/106\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/106\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 4px 8px; transform-origin: 4px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = weighted_average(x,w)\r\n  y =\r\nend","test_suite":"%%\r\nx = [1 2 3];\r\nw = [10 15 20];\r\ny_correct = 100/3;\r\nassert(isequal(weighted_average(x,w),y_correct))\r\n\r\n%%\r\nx = [3 2 1];\r\nw = [10 15 20];\r\ny_correct = 80/3;\r\nassert(isequal(weighted_average(x,w),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":6,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":426,"test_suite_updated_at":"2022-01-13T16:57:06.000Z","rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-09T04:58:13.000Z","updated_at":"2026-03-16T19:00:14.000Z","published_at":"2017-11-09T04:58:13.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 二つのベクトル [1 2 3] と [10 15 20] が与えられたとき、\\n それぞれの要素ごとの積の平均を取ると、\\n 解は 33.3333 となります。\\n 途中の計算は (1*10 + 2*15 + 3*20)/3 のようになります。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 106. Weighted average\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/106\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/106\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44551,"title":"Calcular la razón de proporcionalidad ","description":"Dadas dos magnitudes (a y b) en forma de vectores, crear una función que permita obtener la razón de proporcionalidad _*m*_ sólo en aquellos casos en los que exista una relación de proporcionalidad directa entre ambas.\r\n\r\n* *Ejemplo 1:*\r\n\r\n  a = [1 2 3 4]\r\nb = [2 4 6 8]\r\n\r\nRelación proporcional de razón m = 2.\r\n\r\n* *Ejemplo 2:* \r\n\r\n  a = [1 2 3 4]\r\n  b = [1 6 3 2]\r\n\r\nNo existe relación de proporcionalidad, por lo que m = 0.","description_html":"\u003cp\u003eDadas dos magnitudes (a y b) en forma de vectores, crear una función que permita obtener la razón de proporcionalidad \u003ci\u003e\u003cb\u003em\u003c/b\u003e\u003c/i\u003e sólo en aquellos casos en los que exista una relación de proporcionalidad directa entre ambas.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eEjemplo 1:\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cpre class=\"language-matlab\"\u003ea = [1 2 3 4]\r\nb = [2 4 6 8]\r\n\u003c/pre\u003e\u003cp\u003eRelación proporcional de razón m = 2.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cb\u003eEjemplo 2:\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cpre class=\"language-matlab\"\u003ea = [1 2 3 4]\r\nb = [1 6 3 2]\r\n\u003c/pre\u003e\u003cp\u003eNo existe relación de proporcionalidad, por lo que m = 0.\u003c/p\u003e","function_template":"% Se trata de la plantilla inicial que aparecerá cuando el alumno se disponga a resolver el problema.\r\n\r\nfunction m = razon_proporcionalidad(a,b)\r\n  \r\nend","test_suite":"% Se deberá definir una serie de casos en los que comprobar el resultado obtenido por los alumnos \r\n% y el resultado correcto. De esta manera, si la respuesta al problema consigue superar todos los \r\n% test, se dará la respuesta como válida. \r\n\r\n%% TEST 1\r\na = [1 2 3 4];\r\nb = [2 4 6 8];\r\nm_correct = 2;\r\nassert(isequal(razon_proporcionalidad(a,b),m_correct))\r\n\r\n%% TEST 2\r\na = [1 2 3 4];\r\nb = [1 4 2 8];\r\nm_correct = 0;\r\nassert(isequal(razon_proporcionalidad(a,b),m_correct))\r\n\r\n%% TEST 3\r\na = [3 5 12 1.5];\r\nb = [10.5 17.5 42 5.25];\r\nm_correct = 3.5;\r\nassert(isequal(razon_proporcionalidad(a,b),m_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":132597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-11T12:21:16.000Z","updated_at":"2026-03-11T09:42:50.000Z","published_at":"2018-04-17T18:00:04.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDadas dos magnitudes (a y b) en forma de vectores, crear una función que permita obtener la razón de proporcionalidad\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e sólo en aquellos casos en los que exista una relación de proporcionalidad directa entre ambas.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo 1:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = [1 2 3 4]\\nb = [2 4 6 8]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRelación proporcional de razón m = 2.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo 2:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = [1 2 3 4]\\nb = [1 6 3 2]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNo existe relación de proporcionalidad, por lo que m = 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44411,"title":"テレビのサイズを求めてみよう","description":"あなたは電気屋で働いています。\r\n\r\nあなたの電気屋にテレビを買いに来たお客さんに「何インチのテレビを買いたいのか」と質問したところ、対角線の情報しかわからないと言われてしまいました。\r\n\r\nしかし、テレビのインチを知るには、幅と高さの情報が必要です。\r\n \r\nすべてのテレビの縦横比が 9 : 16 であると仮定した上で、画面の対角線の長さを入れると画面の幅と高さの値をそれぞれ返す関数を作成してみましょう。\r\n\r\n* (英語版) Problem 43008. What's size of TV?\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43008\u003e","description_html":"\u003cp\u003eあなたは電気屋で働いています。\u003c/p\u003e\u003cp\u003eあなたの電気屋にテレビを買いに来たお客さんに「何インチのテレビを買いたいのか」と質問したところ、対角線の情報しかわからないと言われてしまいました。\u003c/p\u003e\u003cp\u003eしかし、テレビのインチを知るには、幅と高さの情報が必要です。\u003c/p\u003e\u003cp\u003eすべてのテレビの縦横比が 9 : 16 であると仮定した上で、画面の対角線の長さを入れると画面の幅と高さの値をそれぞれ返す関数を作成してみましょう。\u003c/p\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 43008. What's size of TV? \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43008\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/43008\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function [width height] = TV(x)\r\n  width =\r\n  height =\r\nend\r\n","test_suite":"%%\r\nx = 40;\r\ny_correct = [34.86 19.61];\r\n[y1 y2]=TV(x)\r\nassert(y1-y_correct(1)\u003c=0.01 \u0026\u0026 y2-y_correct(2)\u003c=0.01)\r\n \r\n%%\r\nx=49\r\ny_correct = [42.71 24.02];\r\n[y1 y2]=TV(x)\r\nassert(y1-y_correct(1)\u003c=0.01 \u0026\u0026 y2-y_correct(2)\u003c=0.01)\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":1,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":322,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-16T01:50:14.000Z","updated_at":"2026-03-16T19:30:39.000Z","published_at":"2017-11-16T01:50:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eあなたは電気屋で働いています。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eあなたの電気屋にテレビを買いに来たお客さんに「何インチのテレビを買いたいのか」と質問したところ、対角線の情報しかわからないと言われてしまいました。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eしかし、テレビのインチを知るには、幅と高さの情報が必要です。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eすべてのテレビの縦横比が 9 : 16 であると仮定した上で、画面の対角線の長さを入れると画面の幅と高さの値をそれぞれ返す関数を作成してみましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 43008. What's size of TV?\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43008\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/43008\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44612,"title":"¡Puntos de corte!","description":"Crea una función que permita calcular los puntos de corte con los ejes X e Y de una función cuadrática indicada por el usuario en base a la siguiente ecuación:\r\n\r\ny = a*x^2+b*x+c \r\n\r\nDonde el usuario introducirá los parámetros *a*, *b* y *c*\r\n\r\n* *Ejemplo*\r\n\r\nDada la función cuadrática y = -2*x^2-12*x-10, se obtiene que los puntos de corte con el eje X son P1(-5,0) y P2(-1,0), así como el punto de corte con el eje Y P3(0,-10).\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 97px; vertical-align: baseline; perspective-origin: 332px 97px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; perspective-origin: 309px 21px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCrea una función que permita calcular los puntos de corte con los ejes X e Y de una función cuadrática indicada por el usuario en base a la siguiente ecuación:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ey = a*x^2+b*x+c\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eDonde el usuario introducirá los parámetros\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003ea\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e,\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eb\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e y\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003ec\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-bottom: 20px; margin-top: 10px; transform-origin: 316px 10px; perspective-origin: 316px 10px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"display: list-item; margin-bottom: 0px; margin-left: 56px; margin-top: 0px; text-align: left; transform-origin: 288px 10px; white-space: pre-wrap; perspective-origin: 288px 10px; margin-left: 56px; \"\u003e\u003cspan style=\"display: inline; margin-left: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eEjemplo\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; perspective-origin: 309px 21px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eDada la función cuadrática y = -2*x^2-12*x-10, se obtiene que los puntos de corte con el eje X son P1(-5,0) y P2(-1,0), así como el punto de corte con el eje Y P3(0,-10).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [puntos_corte] = puntos_corte(a,b,c)\r\n  \r\nend","test_suite":"%% TEST 1\r\na = -2;\r\nb = -12;\r\nc = -10;\r\n[puntos_corte_correct] = [-5 -1 -10];\r\nassert(isequal(puntos_corte(a,b,c),puntos_corte_correct))\r\n\r\n%% TEST 2\r\na = 1;\r\nb = -3;\r\nc = -4;\r\n[puntos_corte_correct] = [-1 4 -4];\r\nassert(isequal(puntos_corte(a,b,c),puntos_corte_correct))\r\n\r\n%% TEST 3\r\na = 2;\r\nb = -2;\r\nc = -4;\r\n[puntos_corte_correct] = [-1 2 -4];\r\nassert(isequal(puntos_corte(a,b,c),puntos_corte_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":132597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":"2020-09-29T15:58:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-16T07:55:46.000Z","updated_at":"2026-01-29T15:33:54.000Z","published_at":"2018-04-17T18:00:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCrea una función que permita calcular los puntos de corte con los ejes X e Y de una función cuadrática indicada por el usuario en base a la siguiente ecuación:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = a*x^2+b*x+c\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDonde el usuario introducirá los parámetros\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e y\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEjemplo\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDada la función cuadrática y = -2*x^2-12*x-10, se obtiene que los puntos de corte con el eje X son P1(-5,0) y P2(-1,0), así como el punto de corte con el eje Y P3(0,-10).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44417,"title":"英語の文章内の母音を取り除くコードを書きましょう。","description":"与えられた英語の文章内の母音を取り除きましょう。\r\n\r\n例:\r\n\r\n 入力 s1 が 'Jack and Jill went up the hill' の場合、\r\n 出力 s2 は 'Jck nd Jll wnt p th hll'\r\n\r\n* (英語版) Problem 22. Remove the vowels\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/22\u003e","description_html":"\u003cp\u003e与えられた英語の文章内の母音を取り除きましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e 入力 s1 が 'Jack and Jill went up the hill' の場合、\r\n 出力 s2 は 'Jck nd Jll wnt p th hll'\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 22. Remove the vowels \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/22\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/22\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function s2 = refcn(s1)\r\n    s2 = s1;\r\nend","test_suite":"%%\r\ns1 = 'Jack and Jill went up the hill'; \r\ns2 = 'Jck nd Jll wnt p th hll';\r\nassert(isequal(s2,refcn(s1)))\r\n%%\r\ns1 = 'I don''t want to work. I just want to bang on the drum all day.'; \r\ns2 = ' dn''t wnt t wrk.  jst wnt t bng n th drm ll dy.'; \r\nassert(isequal(s2,refcn(s1)))","published":true,"deleted":false,"likes_count":5,"comments_count":6,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":326,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-27T09:18:36.000Z","updated_at":"2026-03-16T19:32:28.000Z","published_at":"2017-11-27T09:18:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e与えられた英語の文章内の母音を取り除きましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 入力 s1 が 'Jack and Jill went up the hill' の場合、\\n 出力 s2 は 'Jck nd Jll wnt p th hll']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 22. Remove the vowels\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/22\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/22\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44398,"title":"ベクトルの値が増加しているかを調べよう","description":"ベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。\r\n\r\n例:\r\n\r\n   入力が  x = [-3 0 7] のとき、\r\n   関数の出力 tf は true を返します。\r\n\r\n   入力が  x = [2 2] のとき、\r\n   関数の出力 tf は false を返します。\r\n\r\n* (英語版) Problem 10. Determine whether a vector is monotonically increasing\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\u003e","description_html":"\u003cp\u003eベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e   入力が  x = [-3 0 7] のとき、\r\n   関数の出力 tf は true を返します。\u003c/pre\u003e\u003cpre\u003e   入力が  x = [2 2] のとき、\r\n   関数の出力 tf は false を返します。\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 10. Determine whether a vector is monotonically increasing \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function tf = mono_increase(x)\r\n  tf = false;\r\nend","test_suite":"%%\r\nx = [0 1 2 3 4];\r\nassert(isequal(mono_increase(x),true));\r\n%%\r\nx = [0];\r\nassert(isequal(mono_increase(x),true));\r\n%%\t\r\nx = [0 0 0 0 0];\r\nassert(isequal(mono_increase(x),false));\r\n%%\t\r\nx = [0 1 2 3 -4];\r\nassert(isequal(mono_increase(x),false));\r\n%%\t\r\nx = [-3 -4 2 3 4];\r\nassert(isequal(mono_increase(x),false));\r\n%%\r\nx = 1:.1:10;\r\nassert(isequal(mono_increase(x),true));\r\n%%\t\r\nx = cumsum(rand(1,100));\r\nx(5) = -1;\r\nassert(isequal(mono_increase(x),false));\r\n%%\t\r\nx = cumsum(rand(1,50));\r\nassert(isequal(mono_increase(x),true));","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":367,"test_suite_updated_at":"2017-11-05T23:19:13.000Z","rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-05T23:15:41.000Z","updated_at":"2026-03-17T03:46:51.000Z","published_at":"2017-11-05T23:19:13.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   入力が  x = [-3 0 7] のとき、\\n   関数の出力 tf は true を返します。\\n\\n   入力が  x = [2 2] のとき、\\n   関数の出力 tf は false を返します。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 10. Determine whether a vector is monotonically increasing\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/10-determine-whether-a-vector-is-monotonically-increasing\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44419,"title":"対称で、n*2n のサイズの行列を作成しましょう","description":"サイズが n*2n の \"mirror\" 行列（対称行列）を作成しましょう。\r\n \r\n例: \r\nn=2 の場合、以下のような出力を返します。\r\n\r\n  m = [ 1 2 2 1\r\n         1 2 2 1 ]\r\n\r\nn = 3 の場合、以下のようになります。\r\n\r\n m = [ 1 2 3 3 2 1\r\n       1 2 3 3 2 1\r\n       1 2 3 3 2 1 ]\r\n\r\n* (英語版) Problem 943. \"mirror\" matrix\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/943\u003e","description_html":"\u003cp\u003eサイズが n*2n の \"mirror\" 行列（対称行列）を作成しましょう。\u003c/p\u003e\u003cp\u003e例: \r\nn=2 の場合、以下のような出力を返します。\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003em = [ 1 2 2 1\r\n       1 2 2 1 ]\r\n\u003c/pre\u003e\u003cp\u003en = 3 の場合、以下のようになります。\u003c/p\u003e\u003cpre\u003e m = [ 1 2 3 3 2 1\r\n       1 2 3 3 2 1\r\n       1 2 3 3 2 1 ]\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 943. \"mirror\" matrix \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/943\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/943\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function m = mirror_matrix(n)\r\n  m = ones(n,2*n);\r\nend","test_suite":"%%\r\nn = 1;\r\nm_correct = [1 1];\r\nassert(isequal(mirror_matrix(n),m_correct))\r\n%%\r\nn = 3;\r\nm_correct = [1 2 3 3 2 1; 1 2 3 3 2 1; 1 2 3 3 2 1];\r\nassert(isequal(mirror_matrix(n),m_correct))\r\n%%\t\r\nn = 33;\r\nm_correct = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1;];\r\nassert(isequal(mirror_matrix(n),m_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":319,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-28T06:44:34.000Z","updated_at":"2026-03-16T19:33:51.000Z","published_at":"2017-11-28T06:44:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eサイズが n*2n の \\\"mirror\\\" 行列（対称行列）を作成しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例: n=2 の場合、以下のような出力を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[m = [ 1 2 2 1\\n       1 2 2 1 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 3 の場合、以下のようになります。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ m = [ 1 2 3 3 2 1\\n       1 2 3 3 2 1\\n       1 2 3 3 2 1 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 943. \\\"mirror\\\" matrix\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/943\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/943\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44404,"title":"行列内の素数の平均をとろう","description":"行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。\r\n\r\n例: \r\n\r\n   入力の行列が  in = [ 8 3\r\n   　　　　　　　　　　　5 9 ]  のとき、\r\n   出力が 4 あるいは (3+5)/2 のようになります。\r\n\r\n* (英語版) Problem 14. Find the numeric mean of the prime numbers in a matrix.\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/14\u003e","description_html":"\u003cp\u003e行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e   入力の行列が  in = [ 8 3\r\n   　　　　　　　　　　　5 9 ]  のとき、\r\n   出力が 4 あるいは (3+5)/2 のようになります。\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 14. Find the numeric mean of the prime numbers in a matrix. \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/14\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/14\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function out = meanOfPrimes(in)\r\n  out = in;\r\nend","test_suite":"%%\r\nx = 3;\r\ny_correct = 3;\r\nassert(isequal(meanOfPrimes(x),y_correct))\r\n%%\r\nx = [1 2 3];\r\ny_correct = 2.5;\r\nassert(isequal(meanOfPrimes(x),y_correct))\r\n%%\r\nx = [3 3; 3 3];\r\ny_correct = 3;\r\nassert(isequal(meanOfPrimes(x),y_correct))\r\n%%\t\r\nx = [7 3 8 8]';\r\ny_correct = 5;\r\nassert(isequal(meanOfPrimes(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":351,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-14T00:15:17.000Z","updated_at":"2026-03-18T03:39:39.000Z","published_at":"2017-11-14T00:17:00.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   入力の行列が  in = [ 8 3\\n   　　　　　　　　　　　5 9 ]  のとき、\\n   出力が 4 あるいは (3+5)/2 のようになります。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 14. Find the numeric mean of the prime numbers in a matrix.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/14\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/14\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44399,"title":"二乗になっている数を見つけよう","description":"ある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。\r\n\r\n例:\r\n\r\n 入力が  a = [2 3 4] のとき、\r\n 出力 b は true になります。\r\n\r\n 2の2乗は4であり、ベクトル内に2と4の両方が含まれているため、出力は true になります。\r\n\r\n\r\n* (英語版) Problem 23. Finding Perfect Squares\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\u003e\r\n","description_html":"\u003cp\u003eある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e 入力が  a = [2 3 4] のとき、\r\n 出力 b は true になります。\u003c/pre\u003e\u003cpre\u003e 2の2乗は4であり、ベクトル内に2と4の両方が含まれているため、出力は true になります。\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 23. Finding Perfect Squares \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function b = isItSquared(a)\r\n  b = false;\r\n\r\nend","test_suite":"%%\r\na = [2 3 4];\r\nassert(isequal(isItSquared(a),true))\r\n%%\t\r\na = [20:30];\r\nassert(isequal(isItSquared(a),false))\r\n%%\r\na = [1];\r\nassert(isequal(isItSquared(a),true))\r\n%%\r\na = [6 10 12 14 36 101];\r\nassert(isequal(isItSquared(a),true))\r\n%%\t\r\na = [6 10 12 14 101];\r\nassert(isequal(isItSquared(a),false))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":346,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-07T04:42:01.000Z","updated_at":"2026-03-17T03:50:04.000Z","published_at":"2017-11-07T04:42:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 入力が  a = [2 3 4] のとき、\\n 出力 b は true になります。\\n\\n 2の2乗は4であり、ベクトル内に2と4の両方が含まれているため、出力は true になります。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 23. Finding Perfect Squares\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/23-finding-perfect-squares/solutions/1330236\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44541,"title":"Arrange the names in alphabetical order (2)","description":"Arrange the list of names in alphabetical order, following the German standard \u003chttps://de.wikipedia.org/wiki/Alphabetische_Sortierung#Deutschland *DIN 5007*, Variant 2, §6.1.1.4.2 — _for lists of people's names_\u003e.  \r\n\r\nSpecial characters:   \r\nä = ae,   \r\nö = oe,   \r\nü = ue,   \r\nß = ss.  \r\n\r\nThe above special characters *must* be heeded in determining the correct sequence, and retained unaltered in the final output.  Other accents would typically be ignored, but are in any case not present in the Test Suite.  Hyphens and spaces do not affect the sequence.  \r\n\r\nPrefixes:   \r\nIgnore \u003chttps://de.wikipedia.org/wiki/Namenszusatz#Ursprüngliche_Herkunftsbezeichnungen prefixes\u003e such as \"von\", \"von der\", \"vor\", \"am\", \"zum\". These can, in general, be identified in that they are *not* capitalised — _see example below_.  Capitalisation (uppercase versus lowercase) must be preserved in your final output.  \r\n\r\nSorting should be based on the _surname_ [~family name].  The surname (together with any prefixes!) will always appear _first_, followed by a comma and then the given name(s) [first name(s)].  \r\nIn principle, if two surnames were alike, then one would have to next sort by the given name(s) — however, that situation does *not* arise, and will not arise, in the Test Suite.  \r\n\r\nInputs comprise cell arrays of character vectors.  The cell arrays can be either row or column vectors.  Return your output in the same type of vector.  \r\n\r\nEXAMPLE:\r\n\r\n % Input\r\n in = {'Hofmann, Michael' \r\n       'Hölderlin, Friedrich' \r\n       'Holz, Arno'\r\n       'van Hoddis, Jakob' \r\n       'von Hofmannsthal, Hugo'}\r\n % Output\r\n out = {'van Hoddis, Jakob' \r\n       'Hölderlin, Friedrich' \r\n       'Hofmann, Michael' \r\n       'von Hofmannsthal, Hugo' \r\n       'Holz, Arno'}\r\n\r\nSee also:\r\n\r\n* \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44538 Problem 44538\u003e","description_html":"\u003cp\u003eArrange the list of names in alphabetical order, following the German standard \u003ca href = \"https://de.wikipedia.org/wiki/Alphabetische_Sortierung#Deutschland\"\u003e\u003cb\u003eDIN 5007\u003c/b\u003e, Variant 2, §6.1.1.4.2 — \u003ci\u003efor lists of people's names\u003c/i\u003e\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eSpecial characters:   \r\nä = ae,   \r\nö = oe,   \r\nü = ue,   \r\nß = ss.\u003c/p\u003e\u003cp\u003eThe above special characters \u003cb\u003emust\u003c/b\u003e be heeded in determining the correct sequence, and retained unaltered in the final output.  Other accents would typically be ignored, but are in any case not present in the Test Suite.  Hyphens and spaces do not affect the sequence.\u003c/p\u003e\u003cp\u003ePrefixes:   \r\nIgnore \u003ca href = \"https://de.wikipedia.org/wiki/Namenszusatz#Ursprüngliche_Herkunftsbezeichnungen\"\u003eprefixes\u003c/a\u003e such as \"von\", \"von der\", \"vor\", \"am\", \"zum\". These can, in general, be identified in that they are \u003cb\u003enot\u003c/b\u003e capitalised — \u003ci\u003esee example below\u003c/i\u003e.  Capitalisation (uppercase versus lowercase) must be preserved in your final output.\u003c/p\u003e\u003cp\u003eSorting should be based on the \u003ci\u003esurname\u003c/i\u003e [~family name].  The surname (together with any prefixes!) will always appear \u003ci\u003efirst\u003c/i\u003e, followed by a comma and then the given name(s) [first name(s)].  \r\nIn principle, if two surnames were alike, then one would have to next sort by the given name(s) — however, that situation does \u003cb\u003enot\u003c/b\u003e arise, and will not arise, in the Test Suite.\u003c/p\u003e\u003cp\u003eInputs comprise cell arrays of character vectors.  The cell arrays can be either row or column vectors.  Return your output in the same type of vector.\u003c/p\u003e\u003cp\u003eEXAMPLE:\u003c/p\u003e\u003cpre\u003e % Input\r\n in = {'Hofmann, Michael' \r\n       'Hölderlin, Friedrich' \r\n       'Holz, Arno'\r\n       'van Hoddis, Jakob' \r\n       'von Hofmannsthal, Hugo'}\r\n % Output\r\n out = {'van Hoddis, Jakob' \r\n       'Hölderlin, Friedrich' \r\n       'Hofmann, Michael' \r\n       'von Hofmannsthal, Hugo' \r\n       'Holz, Arno'}\u003c/pre\u003e\u003cp\u003eSee also:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44538\"\u003eProblem 44538\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"% Comments ...\r\nfunction y = meSortEm( xVector )\r\n    z = x;\r\nend","test_suite":"%% Ensure generality\r\n% Don't hardcode solutions or use test-specific lookup tables of surnames.\r\n% (Lookup tables of letters and/or prefixes are allowed, if you want, though.)\r\nRE = regexp(fileread('meSortEm.m'), '\\w+', 'match');\r\ntabooWords = {'Hölderlin' 'Friedrich' 'Holz' 'Arno' ...\r\n                'Hoffmann' 'Josef' 'Hübsch' 'Heinrich' ...\r\n                'Grass' 'Günter' 'Grünberg' 'Arnon' 'Strauch' 'Hugo' 'Strauß' 'Botho' ...\r\n                'Deutsch' 'Gerti' 'Dietrich' 'Adolf' 'Dücker' 'Eugen'};\r\ntestResult = cellfun( @(z) ismember(z, lower(tabooWords)), lower(RE) );\r\nmsg = ['Please do not hard-code your ''solution''.' char([10 13]) 'Found: ' strjoin(RE(testResult)) '.' char([10 13])];\r\nassert( ~any( testResult ), msg )\r\n\r\n\r\n%% A few authors, as in the example from the Problem Statement\r\nlist = {'van Hoddis, Jakob' \r\n       'Hölderlin, Friedrich' \r\n       'Hofmann, Michael' \r\n       'von Hofmannsthal, Hugo' \r\n       'Holz, Arno'};\r\ninput = {'Hofmann, Michael' \r\n       'Hölderlin, Friedrich' \r\n       'Holz, Arno'\r\n       'van Hoddis, Jakob' \r\n       'von Hofmannsthal, Hugo'};\r\nassert( isequal(meSortEm(input), list) )\r\n\r\n\r\n%% Architects\r\ndata = {'Auböck, Maria' 'Behnisch, Günther' 'Böhm, Elisabeth' 'van den Broek, Jo' 'van Campen, Jacob' 'Dudok, Willem Marinus' 'von Erdmannsdorff, Frederick William' 'van Eyck, Aldo' ...\r\n    'Gaddi, Taddeo' 'von Gärtner, Friedrich' 'Galilei, Alessandro' 'Gang, Jeanne' 'Gardella, Ignazio' 'Garnier, Charles' 'Gatermann, Dörte' 'Gauzin-Müller, Dominique' ...\r\n    'von Gontard, Carl' 'Höger, Fritz' 'Hoffmann, Josef' 'Hübsch, Heinrich' 'Hundertwasser, Friedensreich Regentag Dunkelbunt' 'de Key, Lieven' 'de Keyser, Hendrick' 'von Klenze, Leo' ...\r\n    'von Knobelsdorff, Georg Wenzeslaus' 'Mies, Maria Ludwig Michael' 'Mies van der Rohe, Ludwig' 'Pöppelmann, Matthäus Daniel' 'van Ravesteyn, Sybold' 'de Ridder van Groenesteyn, Stefan' 'von Ritter zu Groenesteyn, Caspar Wilhelm' 'von Ritter von Grünstein, Anselm Franz' ...\r\n    'Schneider-Esleben, Paul' 'Schütte-Lihotzky, Margarete' 'Staal-Kropholler, Margaret' 'Stowasser, Friedrich' 'van der Vlugt, Leendert' 'Wils, Jan' 'van Winden, Wilfried' 'van Zuuk, René'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 20+randi(L-20));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Authors\r\ndata = {'von Arnim, Bettina' 'Böll, Heinrich' 'Büchner, Georg' 'Busch, Wilhelm' 'von Doderer, Heimito' 'von Droste-Hülshoff, Annette' 'von Ebner-Eschenbach, Marie' 'von Eichendorff, Joseph' 'von Eschenbach, Wolfram' 'Fleißer, Marieluise' ...\r\n    'Gauß, Karl-Markus' 'Görres, Joseph' 'von Goethe, Johann Wolfgang' 'Grass, Günter' 'Grünberg, Arnon' 'Haasse, Hella' 'Härtling, Peter' 'Hamerling, Robert' 'Handke, Peter' 'von Hardenberg, Georg Philipp Friedrich' ...\r\n    'de Hartog, Jan' 'Heißenbüttel, Helmut' 'Hochhuth, Rolf' 'Hölderlin, Friedrich' 'Hoffmann, E.T.A.' 'von Hofmannsthal, Hugo' 'Jünger, Ernst' 'Kästner, Erich' 'Kaminer, Wladimir' 'Kehlmann, Daniel' ...\r\n    'von Kleist, Heinrich' 'Kofler, Werner' 'Laßwitz, Kurd' 'von Leitner, Karl Gottfried' 'Lenz, Siegfried' 'Lernet-Holenia, Alexander' 'van Loon, Hendrik Willem' 'Nöstlinger, Christine' 'Preußler, Otfried' 'von Pückler-Muskau, Hermann Ludwig Heinrich' ...\r\n    'Raabe, Wilhelm' 'Raimund, Ferdinand' 'Rühmkorf, Peter' 'Strätz, Harald' 'Strahl, Manfred' 'Stramm, August' 'von Straßburg, Gottfried' 'Strasser, Charlot' 'Stratz, Rudolph' 'Straub, Maria Elisabeth' ...\r\n    'Strauch, Hugo' 'Strauß, Botho' 'von Strauß und Torney, Luise Elisabeth' 'Suchenwirt, Peter' 'Sudermann, Hermann' 'Sülzer, Bernd' 'Süskind, Patrick' 'Süßmann, Christel' 'Süverkrüp, Dieter' 'Sula, Marianne' ...\r\n    'Sulzenbacher, Hannes' 'Sulzer, Alain Claude' 'von Suttner, Bertha' 'von Trimberg, Süßkind' 'von der Vogelweide, Walter' 'van den Vondel, Joost' 'Voß, Johann Heinrich' 'de Vries, Anne' 'von Waldenfels, Rudolf' 'Walser, Martin' ...\r\n    'von Weißenburg, Otfrid' 'van de Wetering, Janwillem' 'von Wilpert, Gero' 'von Wolkenstein, Oswald' 'von Zatzikhoven, Ulrich'};\r\ndata = data';\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 35+randi(L-35));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Artists, esp. painters (~A \u0026 D)\r\n% Amended 2018-03-11 to remove duplicate surname.  \r\ndata = {'Albers, Josef' 'Aldenrath, Heinrich Jacob' 'Alexander, William' 'Allers, Christian Wilhelm' 'Daege, Eduard' 'Dähling, Heinrich Anton' 'Dahm, Helen' 'Danckerts, Hendrick' ...\r\n    'Danioth, Heinrich' 'Dauerer, Gabriela' 'Decker, Cornelis Gerritsz' 'Degen, Paul' 'van Delen, Dirck' 'Deutsch, Gerti' 'van Diepenbeeck, Abraham' 'Diepraam, Abraham' ...\r\n    'Dietrich, Adolf' 'Dietz, Feodor' 'von Diez, Wilhelm' 'van Dijck, Floris Claesz' 'Dill, Ludwig' 'von Dillis, Johann Georg' 'Dinger, Fritz' 'Dinglinger, Georg Friedrich' ...\r\n    'Disler, Martin' 'Disteli, Martin' 'Dix, Otto' 'Doepler, Emil' 'Dörbeck, Franz Burchard' 'Doerner, Max' 'Domscheit, Franz' 'Donck, Gerard' ...\r\n    'Doomer, Lambert' 'Dou, Gerard' 'Drache, Heinz' 'Dräger, Anton Josef' 'Dreber, Heinrich' 'Dreesen, Willi' 'Droochsloot, Cornelis' ...\r\n    'Drost, Willem' 'Dryander, Johann Friedrich' 'Dubbels, Hendrick Jacobsz' 'Dubordieu, Pieter' 'Duck, Jacob' 'Dücker, Eugen' 'Dürer, Albrecht' 'Dufaux, Henri' ...\r\n    'Dujardin, Karel' 'Dunker, Balthasar Anton' 'Dusart, Cornelis' 'Duyster, Willem Cornelisz' 'Dyck, Hermann' 'Dziersk, Udo'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 25+randi(L-25));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Hyphenated names\r\n% Added 2018-03-11 to test handling of hyphenation.  \r\ndata = {'Droste, Udo' 'Droste-Doderer, Heimito' 'von Droste-Hülshoff, Gerti' 'Droste-Strauß, Annette' 'Ebner, Wolfram' 'Ebner-Eichendorff, Willem' 'von Ebner-Eschenbach, Marie' 'Ebner-Nöstlinger, Christine' 'von Gauzin, Carl' 'Gauzin-Gatermann, Dominique' ...\r\n    'van Gauzin-Gontard, Dörte' 'Gauzin-Müller, Anton' 'Lernet, Hermann' 'Lernet-Holenia, Willem' 'Lernet-Loon, Hendrik' 'van Lernet-Süßmann, Christel' 'Pückler, Ludwig' 'Pückler-Dauerer, Gabriela' 'von Pückler-Muskau, Otfried' 'Pückler-Preußler, Heinrich'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 10+randi(L-10));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":7,"test_suite_updated_at":"2018-03-11T05:39:54.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2018-03-10T03:11:08.000Z","updated_at":"2018-03-11T05:39:54.000Z","published_at":"2018-03-10T05:27:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eArrange the list of names in alphabetical order, following the German standard\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Alphabetische_Sortierung#Deutschland\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDIN 5007\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, Variant 2, §6.1.1.4.2 —\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efor lists of people's names\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSpecial characters:    ä = ae,    ö = oe,    ü = ue,    ß = ss.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe above special characters\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emust\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be heeded in determining the correct sequence, and retained unaltered in the final output. Other accents would typically be ignored, but are in any case not present in the Test Suite. Hyphens and spaces do not affect the sequence.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePrefixes:    Ignore\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://de.wikipedia.org/wiki/Namenszusatz#Ursprüngliche_Herkunftsbezeichnungen\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eprefixes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e such as \\\"von\\\", \\\"von der\\\", \\\"vor\\\", \\\"am\\\", \\\"zum\\\". These can, in general, be identified in that they are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e capitalised —\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esee example below\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Capitalisation (uppercase versus lowercase) must be preserved in your final output.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSorting should be based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esurname\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [~family name]. The surname (together with any prefixes!) will always appear\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efirst\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, followed by a comma and then the given name(s) [first name(s)]. In principle, if two surnames were alike, then one would have to next sort by the given name(s) — however, that situation does\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e arise, and will not arise, in the Test Suite.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ % Input\\n in = {'Hofmann, Michael' \\n       'Hölderlin, Friedrich' \\n       'Holz, Arno'\\n       'van Hoddis, Jakob' \\n       'von Hofmannsthal, Hugo'}\\n % Output\\n out = {'van Hoddis, Jakob' \\n       'Hölderlin, Friedrich' \\n       'Hofmann, Michael' \\n       'von Hofmannsthal, Hugo' \\n       'Holz, Arno'}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee also:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44538\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44538\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44410,"title":"NaN (欠損値) が含まれている行を削除しよう","description":"行列 A が与えられたとき、その行列の中に NaN (Not a number; 欠損値) の要素がある行を見つけ出し、その行を削除しましょう。\r\n\r\n例: \r\n\r\n A = [  1   5   8 \r\n       -3 NaN  14 \r\n        0   6 NaN ];\r\n\r\nの行列が与えられたとき、関数は以下のようなベクトル B を返します。\r\n\r\n B = [  1   5   8 ]\r\n\r\n* (英語版) Problem 25. Remove any row in which a NaN appears\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/25\u003e","description_html":"\u003cp\u003e行列 A が与えられたとき、その行列の中に NaN (Not a number; 欠損値) の要素がある行を見つけ出し、その行を削除しましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e A = [  1   5   8 \r\n       -3 NaN  14 \r\n        0   6 NaN ];\u003c/pre\u003e\u003cp\u003eの行列が与えられたとき、関数は以下のようなベクトル B を返します。\u003c/p\u003e\u003cpre\u003e B = [  1   5   8 ]\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 25. Remove any row in which a NaN appears \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/25\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/25\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function B = remove_nan_rows(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [  1   5   8 \r\n       -3 NaN  14 \r\n        0   6 NaN ];\r\nB_correct = [  1   5   8 ];\r\nassert(isequal(remove_nan_rows(A),B_correct))\r\n\r\n%%\r\nA = 1:10;\r\nB_correct = A;\r\nassert(isequal(remove_nan_rows(A),B_correct))\r\n\r\n%%\r\n \r\nA = [   1   5   8 \r\n       -3 NaN  14 \r\n        0   6   6];\r\nB_correct = [1 5 8; 0 6 6];\r\nassert(isequal(remove_nan_rows(A),B_correct))\r\n\r\n%%\r\nA = [ 1 3 6 NaN 3 NaN]';\r\nB_correct = [1 3 6 3]';\r\nassert(isequal(remove_nan_rows(A),B_correct))\r\n\r\n%%\r\nA = [ 1 3 6 NaN;\r\n      3 4 2  1];\r\nB_correct = [3 4 2 1];\r\nassert(isequal(remove_nan_rows(A),B_correct))","published":true,"deleted":false,"likes_count":9,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":339,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-16T01:31:51.000Z","updated_at":"2026-03-16T19:23:16.000Z","published_at":"2017-11-16T01:32:05.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e行列 A が与えられたとき、その行列の中に NaN (Not a number; 欠損値) の要素がある行を見つけ出し、その行を削除しましょう。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ A = [  1   5   8 \\n       -3 NaN  14 \\n        0   6 NaN ];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eの行列が与えられたとき、関数は以下のようなベクトル B を返します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ B = [  1   5   8 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 25. Remove any row in which a NaN appears\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/25\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/25\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44408,"title":"ゼロでない要素が一番多い行を探そう","description":"行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。\r\n\r\n例:\r\n\r\n 入力として、行列  \r\n a = [ 1 2 0 0 0\r\n       0 0 5 0 0 \r\n       2 7 0 0 0\r\n       0 6 9 3 3 ]\r\n が与えられたとき、出力 r は 4 を返します。\r\n\r\n* (英語版) Problem 32. Most nonzero elements in row\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/32\u003e","description_html":"\u003cp\u003e行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e 入力として、行列  \r\n a = [ 1 2 0 0 0\r\n       0 0 5 0 0 \r\n       2 7 0 0 0\r\n       0 6 9 3 3 ]\r\n が与えられたとき、出力 r は 4 を返します。\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 32. Most nonzero elements in row \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/32\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/32\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function r = fullest_row(a)\r\n  r = 1\r\nend","test_suite":"%%\r\na = [ ...\r\n 1 2 0 0 0\r\n 0 0 5 0 0 \r\n 2 7 0 0 0\r\n 0 6 9 3 3];\r\nr_correct = 4;\r\nassert(isequal(fullest_row(a),r_correct))\r\n\r\n%%\r\na = [ ...\r\n1 2 0 0 \r\n 0 0 5 0  \r\n 0 6 9 -3\r\n 2 7 0 0 \r\n 0 0 0 0];\r\nr_correct = 3;\r\nassert(isequal(fullest_row(a),r_correct))\r\n%%\r\na = [ ...\r\n 1 0 0 \r\n 0 0 0  \r\n 0 0 0\r\n 0 0 0 \r\n 0 2 3];\r\nr_correct = 5;\r\nassert(isequal(fullest_row(a),r_correct))\r\n%%\r\na = [ ...\r\n 0 \r\n 0  \r\n 0\r\n -3\r\n 0 \r\n 0];\r\nr_correct = 4;\r\nassert(isequal(fullest_row(a),r_correct))","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":345,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-14T23:35:31.000Z","updated_at":"2026-03-18T03:46:35.000Z","published_at":"2017-11-14T23:35:31.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e例:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 入力として、行列  \\n a = [ 1 2 0 0 0\\n       0 0 5 0 0 \\n       2 7 0 0 0\\n       0 6 9 3 3 ]\\n が与えられたとき、出力 r は 4 を返します。]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(英語版) Problem 32. Most nonzero elements in row\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/32\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/32\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44840,"title":"Cody Problems in French : Trouvez la logique Pt.1","description":"On rentre x = 4\r\net il en sort y = 160.\r\nTrouvez la logique entre x et y, aidez-vous de la test suite.\r\nBon courage. \r\n\r\nP.S: L'utilisation de \"^\" est fortement conseillée","description_html":"\u003cp\u003eOn rentre x = 4\r\net il en sort y = 160.\r\nTrouvez la logique entre x et y, aidez-vous de la test suite.\r\nBon courage.\u003c/p\u003e\u003cp\u003eP.S: L'utilisation de \"^\" est fortement conseillée\u003c/p\u003e","function_template":"function y = logic(x)\r\n  y = x;\r\nend","test_suite":"filetext = fileread('logic.m')\r\nassert(isempty(strfind(filetext, 'regexp')),'regexp interdit')\r\nassert(isempty(strfind(filetext, 'assert')),'assert interdit')\r\n\r\n%%\r\nx = 0;\r\ny_correct = 0;\r\nassert(isequal(logic(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 8;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 39;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 7;\r\ny_correct = 7651;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 12;\r\ny_correct = 3188640;\r\nassert(isequal(logic(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":280631,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":21,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-01-28T12:54:11.000Z","updated_at":"2026-01-21T13:46:49.000Z","published_at":"2019-01-28T12:54:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOn rentre x = 4 et il en sort y = 160. Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eP.S: L'utilisation de \\\"^\\\" est fortement conseillée\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44538,"title":"Arrange the names in alphabetical order (1)","description":"Arrange the list of names in alphabetical order. The original 'alphabetical order', that is: from α and β all the way through to ω. We might call this 'alpha-beta-cal order'!\r\nYou do not need to heed the capitalisation (uppercase versus lowercase) in determining the correct sequence, although it must be preserved in your final output.\r\nAccents or diacritics should not be heeded in determining the correct sequence, but should likewise be retained in the final output. This is consistent with some practice, albeit not universal. Only the 'tonos' will be present in the Test Suite (unless you try the optional Bonus Question).\r\nSorting should be based on the surname [family name], where present. The surname will always appear last, if present. In principle, if two surnames were alike, then one would have to next sort by the given name(s) [first name(s)] — however, that situation does not arise, and will not arise, in the Test Suite.\r\nInputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.\r\nEXAMPLE:\r\n % Input\r\n in = {'Δημήτρης Δραγατάκης'; 'Ρίτα Αμπατζή'}\r\n % Output\r\n out = {'Ρίτα Αμπατζή'; 'Δημήτρης Δραγατάκης'}\r\nAlthough Δ (delta, ~d) precedes Ρ (rho, ~r) in the Greek alphabet, we must sort first by surname, for which Α (alpha, ~a) precedes Δ (delta, ~d).\r\nSee also:\r\nProblem 44541","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 543.188px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 333px 271.587px; transform-origin: 333px 271.594px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 21px; text-align: left; transform-origin: 310px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eArrange the list of names in alphabetical order. The\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eoriginal\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e 'alphabetical order', that is: from α and β all the way through to ω. We might call this\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e'alpha-beta-cal order'\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 21px; text-align: left; transform-origin: 310px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou do\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003enot\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e need to heed the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ecapitalisation\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (uppercase versus lowercase) in determining the correct sequence, although it must be preserved in your final output.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 31.5px; text-align: left; transform-origin: 310px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eAccents\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e or diacritics should\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003enot\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e be heeded in determining the correct sequence, but should likewise be retained in the final output. This is consistent with\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/List_of_Greek_place_names\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003esome practice\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, albeit\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.tlg.uci.edu/help/Doc002.html\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003enot universal\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e. Only the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003e'tonos'\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e will be present in the Test Suite (unless you try the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eoptional\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e Bonus Question).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 42px; text-align: left; transform-origin: 310px 42px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSorting should be based on the\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003esurname\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e [family name], where present. The surname will always appear\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003elast\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, if present. In principle, if two surnames were alike, then one would have to next sort by the given name(s) [first name(s)] — however, that situation does\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003enot\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e arise, and will not arise, in the Test Suite.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 21px; text-align: left; transform-origin: 310px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eInputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 10.5px; text-align: left; transform-origin: 310px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEXAMPLE:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.75px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 330px 40.875px; transform-origin: 330px 40.875px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 330px 10.2125px; text-wrap-mode: nowrap; transform-origin: 330px 10.2188px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(2, 128, 9); border-block-start-color: rgb(2, 128, 9); border-bottom-color: rgb(2, 128, 9); border-inline-end-color: rgb(2, 128, 9); border-inline-start-color: rgb(2, 128, 9); border-left-color: rgb(2, 128, 9); border-right-color: rgb(2, 128, 9); border-top-color: rgb(2, 128, 9); caret-color: rgb(2, 128, 9); color: rgb(2, 128, 9); column-rule-color: rgb(2, 128, 9); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(2, 128, 9); text-decoration: none; text-decoration-color: rgb(2, 128, 9); text-emphasis-color: rgb(2, 128, 9); \"\u003e% Input\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 330px 10.2125px; text-wrap-mode: nowrap; transform-origin: 330px 10.2188px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e in = {\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); \"\u003e'Δημήτρης Δραγατάκης'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e; \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); \"\u003e'Ρίτα Αμπατζή'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e}\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 330px 10.2125px; text-wrap-mode: nowrap; transform-origin: 330px 10.2188px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(2, 128, 9); border-block-start-color: rgb(2, 128, 9); border-bottom-color: rgb(2, 128, 9); border-inline-end-color: rgb(2, 128, 9); border-inline-start-color: rgb(2, 128, 9); border-left-color: rgb(2, 128, 9); border-right-color: rgb(2, 128, 9); border-top-color: rgb(2, 128, 9); caret-color: rgb(2, 128, 9); color: rgb(2, 128, 9); column-rule-color: rgb(2, 128, 9); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(2, 128, 9); text-decoration: none; text-decoration-color: rgb(2, 128, 9); text-emphasis-color: rgb(2, 128, 9); \"\u003e% Output\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 0.8px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 0.8px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 0.8px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 0.8px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 330px 10.2125px; text-wrap-mode: nowrap; transform-origin: 330px 10.2188px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e out = {\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); \"\u003e'Ρίτα Αμπατζή'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e; \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); text-decoration: none; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); \"\u003e'Δημήτρης Δραγατάκης'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e}\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 310px 21px; text-align: left; transform-origin: 310px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAlthough Δ (delta, ~d) precedes Ρ (rho, ~r) in the Greek alphabet, we must sort first by surname, for which Α (alpha, ~a) precedes Δ (delta, ~d).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 310px 10.5px; text-align: left; transform-origin: 310px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSee also:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 20.4375px; font-family: Helvetica, Arial, sans-serif; list-style-type: square; margin-block-end: 20px; margin-block-start: 10px; margin-bottom: 20px; margin-top: 10px; perspective-origin: 317px 10.2125px; transform-origin: 317px 10.2188px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"display: list-item; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-start: 56px; margin-left: 56px; margin-top: 0px; perspective-origin: 289px 10.2125px; text-align: left; transform-origin: 289px 10.2188px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/44541\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eProblem 44541\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"% Comments ...\r\nfunction y = meSortEm( xVector )\r\n    z = x;\r\nend","test_suite":"%% Ensure generality\r\n% Don't hardcode solutions or use test-specific lookup tables.\r\n% (Lookup tables of letters are allowed, if you want, though.)\r\nRE = regexp(fileread('meSortEm.m'), '\\w+', 'match');\r\ntabooWords = {'Ἄρειος' 'Ἀριστοφάνης' 'Μαρία' 'Κάλλας' 'Φώτης' 'Καφάτος' ...\r\n        'Χρήστος' 'Δάντης' 'Διονύσιος' 'Δεμέτης' 'Γρηγόρης' 'Μπιθικώτσης' ...\r\n        'Αρετή' 'Κετιμέ' 'Παναγιώτης' 'Κόκορας' 'Ιάκωβος' 'Κολανιάν' ...\r\n        'Μαρινέλλα' 'Κώστας' 'Μουντάκης' 'Ζωρζ' 'Μουστακί'};\r\ntestResult = cellfun( @(z) ismember(z, lower(tabooWords)), lower(RE) );\r\nmsg = ['Please do not hard-code your ''solution''.' char([10 13]) 'Found: ' strjoin(RE(testResult)) '.' char([10 13])];\r\nassert(~any(  cellfun( @(z) ismember(z, lower(tabooWords)), lower(RE) )  ), msg)\r\n\r\n\r\n%% Ancient Greeks\r\n% BONUS QUESTION\r\n% More difficult due to the variety of diacritics present.\r\n% (For credit — or κῦδος — not for points.)\r\ndata = {'Αἰδεσία' 'Αἰνησίδημος' 'Αἰσάρα' 'Ἄρειος' 'Ἀριστοφάνης' ...\r\n        'Ἀριστοφῶν' 'Ἀριστώνυμος' 'Ἀσκληπιόδοτος'};\r\nL = length(data);\r\npassedTheBonusQuestion = true;\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    if ~isequal(meSortEm(input), list),\r\n        passedTheBonusQuestion = false;\r\n        disp('.')\r\n        disp('You have NOT solved the optional Bonus Question.')\r\n        disp('But you can still pass the Test Suite.')\r\n        return;\r\n    end;\r\n    %assert( isequal(meSortEm(input), list) )\r\nend;\r\ndisp('.')\r\ndisp('Congratulations:  you''ve solved the optional Bonus Question.')\r\n\r\n\r\n%% Various occupations\r\ndata = {'Γιάννα Αγγελοπούλου-Δασκαλάκη'\r\n'Οδυσσέας Αλεπουδέλλης'\r\n'Δημήτρης Βάρος'\r\n'Κική Δημουλά'\r\n'Οδυσσέας Ελύτης'\r\n'Αλέξανδρος Αρνόλδος Κωνσταντίνος Ισηγόνης'\r\n'Μαρία Κάλλας'\r\n'Κωνσταντίνος Καραθεοδωρή'\r\n'Φώτης Κ. Καφάτος'\r\n'Δημήτριος Κουκούζης'\r\n'Σπυρίδων Νικολάου Μαρινάτος'\r\n'Ντούλα Μουρίκη'\r\n'Ευστράτιος Ντελάρωφ'\r\n'Ἰωάννης Φωκᾶς'\r\n'Δημήτριος Χριστοδούλου'\r\n'Αριστοτέλης Ωνάσης'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Musicians:  A to ~G\r\ndata = {'Ρίτα Αμπατζή' 'Κώστας Ανδρέου' 'Θεόδωρος Αντωνίου' 'Γρηγόρης Ασίκης' ...\r\n        'Νικόλας Άσιμος' 'Χρήστος Δάντης' 'Διονύσιος Δεμέτης' 'Δημήτρης Δραγατάκης' ...\r\n        'Αντίοχος Ευαγγελάτος' 'Κωνσταντίνος Καραμητρούδης' 'Παύλος Καρρέρ' 'Μιλτιάδης Καρύδης' ...\r\n        'Γιώργος Μπάτης' 'Τζίνα Μπαχάουερ' 'Γρηγόρης Μπιθικώτσης' 'Μαρία Φαραντούρη' ...\r\n        'Γιάννης Χρήστου' 'Πέτρος Χριστοδουλίδης'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n%% Musicians:  ~G to K\r\ndata = {'Κατερίνα Γαρμπή'\r\n'Μιχάλης Γενίτσαρης'\r\n'Αλκίνοος Ιωαννίδης'\r\n'Λεωνίδας Καβάκος'\r\n'Στέλιος Καζαντζίδης'\r\n'Σωτήρης Κακίσης'\r\n'Μανώλης Καλομοίρης'\r\n'Ιάκωβος Καμπανέλλης'\r\n'Ελένη Καραΐνδρου'\r\n'Νίκος Καρβέλας'\r\n'Αντώνιος Κατινάρης'\r\n'Μπάμπης Κατσιώνης'\r\n'Άκης Κατσουπάκης'\r\n'Αρετή Κετιμέ'\r\n'Παναγιώτης Κόκορας'\r\n'Ιάκωβος Κολανιάν'\r\n'Σταύρος Κουγιουμτζής'\r\n'Μάνος Χατζιδάκις'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;\r\n\r\n\r\n%% Musicians:  L to ~M\r\ndata = {'Μάνος Λοΐζος' 'Σωκράτης Μάλαμας' 'Νικόλαος Χαλικιόπουλος Μάντζαρος' ...\r\n    'Μαρινέλλα' 'Γιάννης Μαρκόπουλος' 'Κώστας Μαρτάκης' ...\r\n    'Δημήτρης Μητροπάνος' 'Δημήτρης Μητρόπουλος' 'Αθανάσιος Μικρούτσικος' ...\r\n    'Κώστας Μουντάκης' 'Ζωρζ Μουστακί' 'Οριάνθη Παναγάρη' ...\r\n    'Γεώργιος Kυριάκος Παναγιώτου' 'Δημήτρης Πανούσης' 'Βασιλική Παπαδημητρίου' ...\r\n    'Λευτέρης Παπαδόπουλος' 'Λέανδρος Παπαθανασίου' 'Αθανάσιος Παπακωνσταντίνου' ...\r\n    'Έλενα Παπαρίζου'};\r\nL = length(data);\r\nfor i = 1 : 20\r\n    elsAll = randperm( L );\r\n    elsSome = elsAll(1 : 1+randi(L-1));\r\n    list = data( sort(elsSome) );\r\n    elsInput = randperm( length(list) );\r\n    input = list(elsInput);\r\n    assert( isequal(meSortEm(input), list) )\r\nend;","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":64439,"edited_by":64439,"edited_at":"2025-09-14T15:36:24.000Z","deleted_by":null,"deleted_at":null,"solvers_count":9,"test_suite_updated_at":"2025-09-14T15:36:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-03-09T04:20:18.000Z","updated_at":"2025-09-15T19:47:16.000Z","published_at":"2018-03-09T10:22:08.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eArrange the list of names in alphabetical order. The\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eoriginal\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 'alphabetical order', that is: from α and β all the way through to ω. We might call this\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e'alpha-beta-cal order'\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou do\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e need to heed the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecapitalisation\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (uppercase versus lowercase) in determining the correct sequence, although it must be preserved in your final output.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eAccents\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or diacritics should\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be heeded in determining the correct sequence, but should likewise be retained in the final output. This is consistent with\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/List_of_Greek_place_names\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esome practice\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, albeit\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.tlg.uci.edu/help/Doc002.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003enot universal\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Only the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e'tonos'\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e will be present in the Test Suite (unless you try the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eoptional\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Bonus Question).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSorting should be based on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esurname\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [family name], where present. The surname will always appear\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003elast\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, if present. In principle, if two surnames were alike, then one would have to next sort by the given name(s) [first name(s)] — however, that situation does\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e arise, and will not arise, in the Test Suite.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ % Input\\n in = {'Δημήτρης Δραγατάκης'; 'Ρίτα Αμπατζή'}\\n % Output\\n out = {'Ρίτα Αμπατζή'; 'Δημήτρης Δραγατάκης'}]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAlthough Δ (delta, ~d) precedes Ρ (rho, ~r) in the Greek alphabet, we must sort first by surname, for which Α (alpha, ~a) precedes Δ (delta, ~d).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee also:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44541\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44541\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"term":"tag:\"lingua franca\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"lingua franca\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"lingua franca\"","","\"","lingua franca","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f2f424ef840\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f2f424ef7a0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f2f424eeee0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f2f424efac0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f2f424efa20\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f2f424ef980\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f2f424ef8e0\u003e":"tag:\"lingua franca\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f2f424ef8e0\u003e":"tag:\"lingua franca\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"lingua franca\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"lingua franca\"","","\"","lingua franca","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f2f424ef840\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f2f424ef7a0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f2f424eeee0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f2f424efac0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f2f424efa20\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f2f424ef980\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f2f424ef8e0\u003e":"tag:\"lingua franca\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f2f424ef8e0\u003e":"tag:\"lingua franca\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":44611,"difficulty_rating":"easy"},{"id":44841,"difficulty_rating":"easy"},{"id":44615,"difficulty_rating":"easy"},{"id":44409,"difficulty_rating":"easy"},{"id":2289,"difficulty_rating":"easy"},{"id":44420,"difficulty_rating":"easy"},{"id":44400,"difficulty_rating":"easy"},{"id":44551,"difficulty_rating":"easy"},{"id":44411,"difficulty_rating":"easy"},{"id":44612,"difficulty_rating":"easy-medium"},{"id":44417,"difficulty_rating":"easy-medium"},{"id":44398,"difficulty_rating":"easy-medium"},{"id":44419,"difficulty_rating":"easy-medium"},{"id":44404,"difficulty_rating":"easy-medium"},{"id":44399,"difficulty_rating":"easy-medium"},{"id":44541,"difficulty_rating":"easy-medium"},{"id":44410,"difficulty_rating":"easy-medium"},{"id":44408,"difficulty_rating":"easy-medium"},{"id":44840,"difficulty_rating":"easy-medium"},{"id":44538,"difficulty_rating":"medium"}]}}