{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-07-25T00:41:33.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-07-25T00: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":61431,"title":"Compute Radar Duty Cycle","description":"A pulsed radar transmitter operates for a limited amount of time during each transmission cycle. The duty cycle represents the fraction of time that the transmitter is active compared to the total transmission cycle duration.\r\nCreate a MATLAB function that calculates the duty cycle (DC) of a radar system. The duty cycle must be expressed as a percentage.\r\nThe function must receive three input parameters:\r\nPW: the pulse width, which represents the duration of the transmitted radar pulse; \r\nparameter: a numerical parameter that can represent either the Pulse Repetition Time (PRT) or the Pulse Repetition Frequency (PRF); \r\nparameter_type: a parameter type that specifies whether the numerical parameter represents PRT ('PRT') or PRF ('PRF')\r\nPulse Width (PW) is the duration of the transmitted pulse. It is measured in seconds (s).\r\nPulse Repetition Time (PRT) is the time interval between the beginning of two consecutive transmitted pulses. It represents the duration of one complete transmission cycle. PRT is measured in seconds (s).\r\nPulse Repetition Frequency (PRF) is the number of transmitted pulses per second. PRF is measured in Hertz (Hz).\r\nPRT and PRF are inversely related parameters. A shorter PRT corresponds to a higher PRF, while a longer PRT corresponds to a lower PRF.\r\nThe duty cycle (DC) is usually expressed as a percentage and indicates the percentage of time that the radar transmitter is active during a transmission cycle. The output value must be between 0 and 100, where 100% represents continuous wave (CW) transmission. \r\nThe output duty cycle must be rounded to two decimal places.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 406.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 203.15px; transform-origin: 468.5px 203.15px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 439.125px 8px; transform-origin: 439.125px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA pulsed radar transmitter operates for a limited amount of time during each transmission cycle. The duty cycle represents the fraction of time that the transmitter is active compared to the total transmission cycle duration.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 410.975px 8px; transform-origin: 410.975px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCreate a MATLAB function that calculates the duty cycle (DC) of a radar system. The duty cycle must be expressed as a percentage.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 154.417px 8px; transform-origin: 154.417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe function must receive three input parameters:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 61.3px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 451.5px 30.65px; transform-origin: 451.5px 30.65px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 254.25px 8px; transform-origin: 254.25px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePW: the pulse width, which represents the duration of the transmitted radar pulse; \u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 418.133px 8px; transform-origin: 418.133px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eparameter: a numerical parameter that can represent either the Pulse Repetition Time (PRT) or the Pulse Repetition Frequency (PRF); \u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 374.567px 8px; transform-origin: 374.567px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eparameter_type: a parameter type that specifies whether the numerical parameter represents PRT ('PRT') or PRF ('PRF')\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 57.8583px 8px; transform-origin: 57.8583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ePulse Width (PW)\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: 215.858px 8px; transform-origin: 215.858px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the duration of the transmitted pulse. It is measured in seconds (s).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 93.5833px 8px; transform-origin: 93.5833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ePulse Repetition Time (PRT)\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: 340.342px 8px; transform-origin: 340.342px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the time interval between the beginning of two consecutive transmitted pulses. It represents the duration of one complete transmission cycle. PRT is measured in seconds (s).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 112.767px 8px; transform-origin: 112.767px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ePulse Repetition Frequency (PRF)\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: 248.533px 8px; transform-origin: 248.533px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the number of transmitted pulses per second. PRF is measured in Hertz (Hz).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 437.183px 8px; transform-origin: 437.183px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePRT and PRF are inversely related parameters. A shorter PRT corresponds to a higher PRF, while a longer PRT corresponds to a lower PRF.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 14px 8px; transform-origin: 14px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe \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: 50.95px 8px; transform-origin: 50.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eduty cycle (DC)\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: 366.8px 8px; transform-origin: 366.8px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is usually expressed as a percentage and indicates the percentage of time that the radar transmitter is active during a transmission cycle. The output value must be between 0 and 100, where 100% represents continuous wave (CW) transmission. \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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 191.758px 8px; transform-origin: 191.758px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe output duty cycle must be rounded to two decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function DC = radarDutyCycle(PW, parameter, parameter_type)\r\n  \r\nend","test_suite":"%%\r\nfiletext = fileread('radarDutyCycle.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1: Duty cycle using PRT\r\nPW = 1e-6;         \r\nPRT = 1e-3;        \r\nDC = radarDutyCycle(PW, PRT, 'PRT');\r\nassert(DC == 0.10)\r\n%% Test 2: Duty cycle using PRF\r\nPW = 1e-6;    \r\nPRF = 1000;       \r\nDC = radarDutyCycle(PW, PRF, 'PRF');\r\nassert(DC == 0.10)\r\n%% Test 3: Check equivalence between PRT and PRF\r\nPW = 5e-6;      \r\nPRT = 2e-3;      \r\nPRF = 1/PRT;\r\nDC_PRT = radarDutyCycle(PW, PRT, 'PRT');\r\nDC_PRF = radarDutyCycle(PW, PRF, 'PRF');\r\nassert(DC_PRT == DC_PRF)\r\n%% Test 4: Medium duty cycle radar\r\nPW = 50e-6; \r\nPRF = 5000;    \r\nDC = radarDutyCycle(PW, PRF, 'PRF');\r\nassert(DC == 25)\r\n%% Test 5: Continuous wave (CW) condition\r\nPW = 1e-3;       \r\nPRT = 1e-3;\r\nDC = radarDutyCycle(PW, PRT, 'PRT');\r\nassert(DC == 100)\r\n%% Test 6: Output rounding\r\nPW = 1.2345e-6;\r\nPRF = 1234;\r\nDC = radarDutyCycle(PW, PRF, 'PRF');\r\nassert(DC == 0.15)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T15:39:19.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T15:37:12.000Z","updated_at":"2026-07-29T20:35:00.000Z","published_at":"2026-07-29T15:37:12.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\u003eA pulsed radar transmitter operates for a limited amount of time during each transmission cycle. The duty cycle represents the fraction of time that the transmitter is active compared to the total transmission cycle duration.\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\u003eCreate a MATLAB function that calculates the duty cycle (DC) of a radar system. The duty cycle must be expressed as a percentage.\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\u003eThe function must receive three input parameters:\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\u003ePW: the pulse width, which represents the duration of the transmitted radar pulse; \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\u003eparameter: a numerical parameter that can represent either the Pulse Repetition Time (PRT) or the Pulse Repetition Frequency (PRF); \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\u003eparameter_type: a parameter type that specifies whether the numerical parameter represents PRT ('PRT') or PRF ('PRF')\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePulse Width (PW)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the duration of the transmitted pulse. It is measured in seconds (s).\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePulse Repetition Time (PRT)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the time interval between the beginning of two consecutive transmitted pulses. It represents the duration of one complete transmission cycle. PRT is measured in seconds (s).\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePulse Repetition Frequency (PRF)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the number of transmitted pulses per second. PRF is measured in Hertz (Hz).\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\u003ePRT and PRF are inversely related parameters. A shorter PRT corresponds to a higher PRF, while a longer PRT corresponds to a lower PRF.\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\u003eThe \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eduty cycle (DC)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is usually expressed as a percentage and indicates the percentage of time that the radar transmitter is active during a transmission cycle. The output value must be between 0 and 100, where 100% represents continuous wave (CW) transmission. \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\u003eThe output duty cycle must be rounded to two decimal places.\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":61433,"title":"Compute Average Power of a Pulsed Radar","description":"Compute the average transmitted power of a pulsed radar over one pulse repetition time. The inputs are the peak power Pp (Watt [W]), the pulse width PW (seconds [s]), and the pulse repetition time PRT (seconds [s])  which is the time interval between the start of two consecutive radar pulses. . \r\nThe function returns the average power Pavg in watts ([W]), rounded to two decimal places.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 94.35px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 47.175px; transform-origin: 468.5px 47.175px; \"\u003e\u003cdiv style=\"block-size: 63.9px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 31.95px; text-align: left; transform-origin: 444.5px 31.95px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 373.425px 7.79167px; transform-origin: 373.425px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCompute the average transmitted power of a pulsed radar over one pulse repetition time. The inputs are the peak power \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePp\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: 48.7167px 7.79167px; transform-origin: 48.7167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (Watt [W]), the pulse width \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePW\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: 135.742px 7.79167px; transform-origin: 135.742px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (seconds [s]), and the pulse repetition time \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: 11.55px 7.79167px; transform-origin: 11.55px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 11.55px 8.25px; transform-origin: 11.55px 8.25px; \"\u003ePRT\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: 239.192px 7.79167px; transform-origin: 239.192px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (seconds [s])  which is the time interval between the start of two consecutive radar pulses. . \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.45px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.725px; text-align: left; transform-origin: 444.5px 10.725px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 124.083px 7.79167px; transform-origin: 124.083px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe function returns the average power \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: 15.4px 7.79167px; transform-origin: 15.4px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003ePavg\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: 143.125px 7.79167px; transform-origin: 143.125px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in watts ([W]), rounded to two decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Pavg = averageRadarPower(PRT,Pp,PW)\r\n   \r\nend","test_suite":"%%\r\nfiletext = fileread('averageRadarPower.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%%\r\nassert(isequal(averageRadarPower(1e-3,1000,1e-6),1.00))\r\n%%\r\nassert(isequal(averageRadarPower(2e-3,5000,5e-6),12.50))\r\n%%\r\nassert(isequal(averageRadarPower(1e-2,2e6,2e-6),400.00))\r\n%%\r\nassert(isequal(averageRadarPower(1e-3,1000,1e-6),1.00))\r\n%%\r\nassert(isequal(averageRadarPower(2e-3,5000,5e-6),12.50))\r\n%%\r\nassert(isequal(averageRadarPower(1e-2,2e6,2e-6),400.00))\r\n%%\r\nassert(isequal(averageRadarPower(5e-3,8000,4e-6),6.40))\r\n%%\r\nassert(isequal(averageRadarPower(1e-3,2500,2e-6),5.00))\r\n%%\r\nassert(isequal(averageRadarPower(8e-3,1e5,1e-5),125.00))\r\n%%\r\nassert(isequal(averageRadarPower(4e-3,7500,8e-6),15.00))\r\n%%\r\nassert(isequal(averageRadarPower(2e-2,3e6,1e-6),150.00))\r\n%%\r\nassert(isequal(averageRadarPower(3e-3,12345,7e-6),28.81))\r\n%%\r\nassert(isequal(averageRadarPower(7e-3,9876,3e-6),4.23))\r\n%%\r\nassert(isequal(averageRadarPower(1.5e-3,4567,8e-6),24.36))\r\n%%\r\nassert(isequal(averageRadarPower(2.5e-3,13579,4e-6),21.73))\r\n%%\r\nassert(isequal(averageRadarPower(6e-3,22222,9e-6),33.33))\r\n%%\r\nassert(isequal(averageRadarPower(1,1,1/3),0.33))\r\n%%\r\nassert(isequal(averageRadarPower(1,10,1/6),1.67))\r\n%%\r\nassert(isequal(averageRadarPower(1,5,2/9),1.11))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-30T07:15:27.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":"2026-07-30T07:09:39.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T07:09:22.000Z","updated_at":"2026-07-30T09:12:58.000Z","published_at":"2026-07-30T07:09:22.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\u003eCompute the average transmitted power of a pulsed radar over one pulse repetition time. The inputs are the peak power \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (Watt [W]), the pulse width \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePW\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (seconds [s]), and the pulse repetition time \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePRT\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (seconds [s])  which is the time interval between the start of two consecutive radar pulses. . \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\u003eThe function returns the average power \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePavg\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in watts ([W]), rounded to two decimal places.\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":61435,"title":"Radar Unambiguous Range Determination","description":"This problem aims to determine the radar unambiguous range based on the Pulse Repetition Frequency (PRF). The function takes the PRF value as input, expressed in Hertz (Hz), and calculates the maximum range at which a target can be detected without ambiguity.\r\nThe speed of light is used as a constant parameter, with a value of c = 299792458 meters per second (m/s). The output of the function is the unambiguous range, expressed in meters (m), rounded to two decimal places..\r\nThe calculation assumes that the pulse duration is negligible compared to the Pulse Repetition Time (PRT), since the pulse width is typically much smaller than the time interval between consecutive transmitted pulses. Therefore, the effect of pulse duration is neglected.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 72px; transform-origin: 468.5px 72px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 433.317px 7.79167px; transform-origin: 433.317px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis problem aims to determine the radar unambiguous range based on the Pulse Repetition Frequency (PRF). The function takes the PRF value as input, expressed in Hertz (Hz), and calculates the maximum range at which a target can be detected without ambiguity.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 435.425px 7.79167px; transform-origin: 435.425px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe speed of light is used as a constant parameter, with a value of c = 299792458 meters per second (m/s). The output of the function is the unambiguous range, expressed in meters (m), rounded to two decimal places..\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 434.5px 7.79167px; transform-origin: 434.5px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe calculation assumes that the pulse duration is negligible compared to the Pulse Repetition Time (PRT), since the pulse width is typically much smaller than the time interval between consecutive transmitted pulses. Therefore, the effect of pulse duration is neglected.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function unambiguous_range = calculate_unambiguous_range(PRF)\r\n    \r\nend","test_suite":"%%\r\nfiletext = fileread('calculate_unambiguous_range.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nPRF = 1000;\r\nexpected_range = 149896.23;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)\r\n%% Test 2\r\nPRF = 5000;\r\nexpected_range = 29979.25;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)\r\n%% Test 3\r\nPRF = 200;\r\nexpected_range = 749481.15;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)\r\n% Test 4: \r\nPRF = 10000;\r\nexpected_range = 14989.62;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)\r\n% Test 5:\r\nPRF = 1500;\r\nexpected_range = 99930.82;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T08:46:34.000Z","updated_at":"2026-07-30T08:46:49.000Z","published_at":"2026-07-30T08:46:34.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\u003eThis problem aims to determine the radar unambiguous range based on the Pulse Repetition Frequency (PRF). The function takes the PRF value as input, expressed in Hertz (Hz), and calculates the maximum range at which a target can be detected without ambiguity.\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\u003eThe speed of light is used as a constant parameter, with a value of c = 299792458 meters per second (m/s). The output of the function is the unambiguous range, expressed in meters (m), rounded to two decimal places..\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\u003eThe calculation assumes that the pulse duration is negligible compared to the Pulse Repetition Time (PRT), since the pulse width is typically much smaller than the time interval between consecutive transmitted pulses. Therefore, the effect of pulse duration is neglected.\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":61437,"title":"Calculation of Radar Dwell Time","description":"This problem aims to determine the dwell time of a 2D-search radar antenna. The function takes as input the antenna horizontal beamwidth thetaAz and the antenna rotation speed n, and calculates the time during which the radar beam illuminates a target during one scan.\r\nThe horizontal beamwidth is expressed in degrees (°), while the antenna rotation speed is expressed in revolutions per minute (RPM). The output of the function is the dwell time Td, expressed in seconds (s).\r\nThe calculation assumes a constant antenna rotation speed and a uniform azimuthal scan, neglecting acceleration and deceleration effects during antenna movement.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 72px; transform-origin: 468.5px 72px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 432.55px 7.79167px; transform-origin: 432.55px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis problem aims to determine the dwell time of a 2D-search radar antenna. The function takes as input the antenna horizontal beamwidth thetaAz and the antenna rotation speed n, and calculates the time during which the radar beam illuminates a target during one scan.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 429.917px 7.79167px; transform-origin: 429.917px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe horizontal beamwidth is expressed in degrees (°), while the antenna rotation speed is expressed in revolutions per minute (RPM). The output of the function is the dwell time Td, expressed in seconds (s).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 431.667px 7.79167px; transform-origin: 431.667px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe calculation assumes a constant antenna rotation speed and a uniform azimuthal scan, neglecting acceleration and deceleration effects during antenna movement.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Td = calculate_dwell_time(thetaAz, n)\r\n \r\nend","test_suite":"%%\r\nfiletext = fileread('calculate_dwell_time.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'conv')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nthetaAz = 2;     \r\nn = 12;           \r\nexpected_Td = 0.0278;  \r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n%% Test 2\r\nthetaAz = 1;      \r\nn = 12;           \r\nexpected_Td = 0.0139;\r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n%% Test 3\r\nthetaAz = 2;\r\nn = 6;\r\nexpected_Td = 0.0556;\r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n%% Test 4\r\nthetaAz = 5;\r\nn = 12;\r\nexpected_Td = 0.0694;\r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n%% Test 5\r\nthetaAz = 2;\r\nn = 30;\r\nexpected_Td = 0.0111;\r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T09:19:50.000Z","updated_at":"2026-07-30T09:20:21.000Z","published_at":"2026-07-30T09:19:50.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\u003eThis problem aims to determine the dwell time of a 2D-search radar antenna. The function takes as input the antenna horizontal beamwidth thetaAz and the antenna rotation speed n, and calculates the time during which the radar beam illuminates a target during one scan.\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\u003eThe horizontal beamwidth is expressed in degrees (°), while the antenna rotation speed is expressed in revolutions per minute (RPM). The output of the function is the dwell time Td, expressed in seconds (s).\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\u003eThe calculation assumes a constant antenna rotation speed and a uniform azimuthal scan, neglecting acceleration and deceleration effects during antenna movement.\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":61432,"title":"Compute Radar Wavelength from Frequency","description":"Radar systems operate at electromagnetic frequencies. The wavelength of the transmitted signal is related to the operating frequency through the propagation speed of electromagnetic waves.\r\nThe speed of electromagnetic waves in free space must be considered equal to 299792458 m/s.\r\nCreate a MATLAB function that calculates the radar wavelength (in meters [m]) from the operating frequency (in Hertz [Hz]).\r\nThe function must receive the radar operating frequency as input and return the corresponding wavelength.\r\nThe output wavelength must be rounded to five decimal places.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 162px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 81px; transform-origin: 468.5px 81px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 440.325px 8px; transform-origin: 440.325px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRadar systems operate at electromagnetic frequencies. The wavelength of the transmitted signal is related to the operating frequency through the propagation speed of electromagnetic waves.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 297.967px 8px; transform-origin: 297.967px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe speed of electromagnetic waves in free space must be considered equal to 299792458 m/s.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 382.2px 8px; transform-origin: 382.2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCreate a MATLAB function that calculates the radar wavelength (in meters [m]) from the operating frequency (in Hertz [Hz]).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 331.425px 8px; transform-origin: 331.425px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe function must receive the radar operating frequency as input and return the corresponding wavelength.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 196.05px 8px; transform-origin: 196.05px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe output wavelength must be rounded to five decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function lambda = radarWavelength(f)\r\n% Write your code here\r\nend","test_suite":"%%\r\nfiletext = fileread('radarWavelength.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nf = 10e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.02998)\r\n%% Test 2\r\nf = 3e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.09993)\r\n%% Test 3\r\nf = 5.6e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.05353)\r\n%% Test 4\r\nf = 77e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.00389)\r\n%% Test 5\r\nf1 = 5e9;\r\nf2 = 10e9;\r\nlambda1 = radarWavelength(f1);\r\nlambda2 = radarWavelength(f2);\r\nassert(lambda1 == 2*lambda2)\r\n%% Test 6\r\nf = 1e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.29979)\r\n%% Test 7\r\nf = 35e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.00857)\r\n%% Test 8\r\nf = 120e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.00250)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T15:54:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":"2026-07-29T15:54:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T15:51:56.000Z","updated_at":"2026-07-29T20:36:08.000Z","published_at":"2026-07-29T15:51:56.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\u003eRadar systems operate at electromagnetic frequencies. The wavelength of the transmitted signal is related to the operating frequency through the propagation speed of electromagnetic waves.\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\u003eThe speed of electromagnetic waves in free space must be considered equal to 299792458 m/s.\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\u003eCreate a MATLAB function that calculates the radar wavelength (in meters [m]) from the operating frequency (in Hertz [Hz]).\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\u003eThe function must receive the radar operating frequency as input and return the corresponding wavelength.\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\u003eThe output wavelength must be rounded to five decimal places.\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":61434,"title":"Calculate Radar Pulse Energy","description":"Compute the energy contained in a single radar pulse. The inputs are the peak power Pp (W) and the pulse width PW (s). The pulse repetition time PRT (s), defined as the time interval between the beginning of two consecutive pulses, is not required for this calculation but is related to the radar pulse sequence and average power. The output is the pulse energy Ep in joules (J) rounded to three decimal places., obtained from the transmitted power during the pulse duration.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 85.35px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 42.675px; transform-origin: 468.5px 42.675px; \"\u003e\u003cdiv style=\"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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 42.675px; text-align: left; transform-origin: 444.5px 42.675px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 266.467px 7.79167px; transform-origin: 266.467px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCompute the energy contained in a single radar pulse. The inputs are the peak power \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePp\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: 77.4px 7.79167px; transform-origin: 77.4px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (W) and the pulse width \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePW\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: 77.4px 7.79167px; transform-origin: 77.4px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (s). The pulse repetition time \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: 11.55px 7.79167px; transform-origin: 11.55px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 11.55px 8.25px; transform-origin: 11.55px 8.25px; \"\u003ePRT\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: 409.592px 7.79167px; transform-origin: 409.592px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (s), defined as the time interval between the beginning of two consecutive pulses, is not required for this calculation but is related to the radar pulse sequence and average power. The output is the pulse energy \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003eEp\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: 189.825px 7.79167px; transform-origin: 189.825px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in joules (J) rounded to three decimal places., obtained from the transmitted power during the pulse duration.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Ep = radarPulseEnergy(Pp,PW)\r\n \r\nend","test_suite":"%%\r\nfiletext = fileread('radarPulseEnergy.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%%\r\nassert(isequal(radarPulseEnergy(50e3,2.5e-6),0.125))\r\n%%\r\nassert(isequal(radarPulseEnergy(250e3,5e-6),1.250))\r\n%%\r\nassert(isequal(radarPulseEnergy(1e6,3e-6),3.000))\r\n%%\r\nassert(isequal(radarPulseEnergy(2.5e6,4.5e-6),11.250))\r\n%%\r\nassert(isequal(radarPulseEnergy(5e6,8e-6),40.000))\r\n%%\r\nassert(isequal(radarPulseEnergy(10e6,10e-6),100.000))\r\n%%\r\nassert(isequal(radarPulseEnergy(750e3,3.75e-6),2.813))\r\n%%\r\nassert(isequal(radarPulseEnergy(1.8e6,6.25e-6),11.250))\r\n%%\r\nassert(isequal(radarPulseEnergy(3.2e6,7.85e-6),25.120))\r\n%%\r\nassert(isequal(radarPulseEnergy(7.5e6,4.33e-6),32.475))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T07:27:50.000Z","updated_at":"2026-07-30T07:53:11.000Z","published_at":"2026-07-30T07:27:50.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\u003eCompute the energy contained in a single radar pulse. The inputs are the peak power \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (W) and the pulse width \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePW\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (s). The pulse repetition time \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePRT\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (s), defined as the time interval between the beginning of two consecutive pulses, is not required for this calculation but is related to the radar pulse sequence and average power. The output is the pulse energy \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in joules (J) rounded to three decimal places., obtained from the transmitted power during the pulse duration.\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":61436,"title":"Monostatic Radar Received Power Calculation","description":"This problem aims to determine the received power of a monostatic radar system. The function takes as input the main radar parameters, including transmitted power, antenna gain, wavelength, target radar cross section, and target range, and calculates the power of the received echo signal.\r\nThe calculation is based on the monostatic radar equation, where the same antenna is used for both transmission and reception. The input parameters are expressed using SI units: transmitted power in Watts (W), antenna gain as a dimensionless linear value, wavelength in meters (m), radar cross section in square meters (m²), and target range in meters (m).\r\nThe output of the function is the received power expressed in Watts (W). The calculation assumes ideal propagation conditions and neglects losses due to atmospheric attenuation, system losses, and noise effects.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 186px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 93px; transform-origin: 468.5px 93px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 31.5px; text-align: left; transform-origin: 444.5px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 426.683px 7.79167px; transform-origin: 426.683px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis problem aims to determine the received power of a monostatic radar system. The function takes as input the main radar parameters, including transmitted power, antenna gain, wavelength, target radar cross section, and target range, and calculates the power of the received echo signal.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 31.5px; text-align: left; transform-origin: 444.5px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 430.608px 7.79167px; transform-origin: 430.608px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe calculation is based on the monostatic radar equation, where the same antenna is used for both transmission and reception. The input parameters are expressed using SI units: transmitted power in Watts (W), antenna gain as a dimensionless linear value, wavelength in meters (m), radar cross section in square meters (m²), and target range in meters (m).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 435.4px 7.79167px; transform-origin: 435.4px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe output of the function is the received power expressed in Watts (W). The calculation assumes ideal propagation conditions and neglects losses due to atmospheric attenuation, system losses, and noise effects.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Pr = calculate_received_power(Pt, G, lambda, sigma, R)\r\n\r\nend","test_suite":"%%\r\nfiletext = fileread('calculate_received_power.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nPt = 1000;        \r\nG = 100;          \r\nlambda = 0.03;    \r\nsigma = 10;       \r\nR = 10000;        \r\nexpected_Pr = 4.5354e-15; \r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-18)\r\n%% Test 2\r\nPt = 1000;\r\nG = 100;\r\nlambda = 0.03;\r\nsigma = 50;\r\nR = 10000;\r\nexpected_Pr = 2.2677e-14;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-18)\r\n%% Test 3\r\nPt = 1000;\r\nG = 100;\r\nlambda = 0.03;\r\nsigma = 10;\r\nR = 20000;\r\nexpected_Pr = 2.8346e-16;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-20)\r\n%% Test 4\r\nPt = 5000;\r\nG = 100;\r\nlambda = 0.03;\r\nsigma = 10;\r\nR = 10000;\r\nexpected_Pr = 2.2677e-14;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-18)\r\n%% Test 5\r\nPt = 1000;\r\nG = 100;\r\nlambda = 0.06;\r\nsigma = 10;\r\nR = 10000;\r\nexpected_Pr = 1.8142e-14;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-18)\r\n%% Test 6\r\nPt = 1000;\r\nG = 1;\r\nlambda = 0.03;\r\nsigma = 10;\r\nR = 10000;\r\nexpected_Pr = 4.5354e-19;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-22)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T09:08:24.000Z","updated_at":"2026-07-30T09:08:40.000Z","published_at":"2026-07-30T09:08:23.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\u003eThis problem aims to determine the received power of a monostatic radar system. The function takes as input the main radar parameters, including transmitted power, antenna gain, wavelength, target radar cross section, and target range, and calculates the power of the received echo signal.\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\u003eThe calculation is based on the monostatic radar equation, where the same antenna is used for both transmission and reception. The input parameters are expressed using SI units: transmitted power in Watts (W), antenna gain as a dimensionless linear value, wavelength in meters (m), radar cross section in square meters (m²), and target range in meters (m).\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\u003eThe output of the function is the received power expressed in Watts (W). The calculation assumes ideal propagation conditions and neglects losses due to atmospheric attenuation, system losses, and noise effects.\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":61427,"title":"Calculate Target Doppler Frequency Shift for a Pulse-Doppler Radar","description":"Calculate the target Doppler frequency shift measured by a pulse-Doppler radar.\r\nA radar system operates at a carrier frequency of 10 GHz (X-band). The function must calculate the Doppler frequency produced by an aircraft moving relative to the radar.\r\nThe input parameters are:\r\nthe target motion direction: \"closing\" if the aircraft is approaching the radar, or \"receding\" if the aircraft is moving away from the radar;\r\nthe magnitude of the radial velocity of the aircraft in m/s (a positive value).\r\nAssume the speed of light is c = 299792458 m/s.\r\nThe output must be the Doppler frequency shift in Hz, rounded to two decimal places.\r\nA positive Doppler frequency corresponds to an approaching target, while a negative Doppler frequency corresponds to a receding target.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 253.867px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 126.933px; transform-origin: 468.5px 126.933px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 248.183px 8px; transform-origin: 248.183px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCalculate the target Doppler frequency shift measured by a pulse-Doppler radar.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 442.242px 8px; transform-origin: 442.242px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA radar system operates at a carrier frequency of 10 GHz (X-band). The function must calculate the Doppler frequency produced by an aircraft moving relative to the radar.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 80.5167px 8px; transform-origin: 80.5167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe input parameters are:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 451.5px 20.4333px; transform-origin: 451.5px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 410.95px 8px; transform-origin: 410.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethe target motion direction: \"closing\" if the aircraft is approaching the radar, or \"receding\" if the aircraft is moving away from the radar;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 228.317px 8px; transform-origin: 228.317px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethe magnitude of the radial velocity of the aircraft in m/s (a positive value).\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 151.117px 8px; transform-origin: 151.117px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAssume the speed of light is c = 299792458 m/s.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 264.108px 8px; transform-origin: 264.108px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe output must be the Doppler frequency shift in Hz, rounded to two decimal places.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 425.575px 8px; transform-origin: 425.575px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA positive Doppler frequency corresponds to an approaching target, while a negative Doppler frequency corresponds to a receding target.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(target_type, vr)\r\n  y =\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\n%% Closing target\r\nyour_fcn_name(\"closing\",300)\r\nassert(isequal(your_fcn_name(\"closing\",300),20013.85))\r\n%% Receding target\r\nassert(isequal(your_fcn_name(\"receding\",300),-20013.85))\r\n%% Different velocity\r\nassert(isequal(your_fcn_name(\"closing\",100), 6671.28))\r\n%% Zero radial velocity\r\nassert(isequal(your_fcn_name(\"closing\",0), 0.00))\r\n%% High speed aircraft\r\nassert(isequal(your_fcn_name(\"closing\",1000),66712.82))\r\n%% High speed receding target\r\nassert(isequal(your_fcn_name(\"receding\",1000),-66712.82))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T10:32:44.000Z","deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2026-07-29T10:18:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T10:17:42.000Z","updated_at":"2026-07-30T14:07:01.000Z","published_at":"2026-07-29T10:17:42.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\u003eCalculate the target Doppler frequency shift measured by a pulse-Doppler radar.\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\u003eA radar system operates at a carrier frequency of 10 GHz (X-band). The function must calculate the Doppler frequency produced by an aircraft moving relative to the radar.\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\u003eThe input parameters are:\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\u003ethe target motion direction: \\\"closing\\\" if the aircraft is approaching the radar, or \\\"receding\\\" if the aircraft is moving away from the radar;\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\u003ethe magnitude of the radial velocity of the aircraft in m/s (a positive value).\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\u003eAssume the speed of light is c = 299792458 m/s.\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\u003eThe output must be the Doppler frequency shift in Hz, rounded to two decimal places.\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\u003eA positive Doppler frequency corresponds to an approaching target, while a negative Doppler frequency corresponds to a receding target.\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":61430,"title":"Radar Target Distance Calculation","description":"A radar system sends a short electromagnetic pulse toward a target and measures the elapsed time between transmission and reception of the reflected echo.\r\nWrite a function that takes this elapsed time in seconds as input and returns the estimated target distance in meters, rounded to two decimal places.\r\nAssume that the pulse travels at the speed of light (c = 299792458 m/s).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 61.5px; transform-origin: 468.5px 61.5px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 444.5px 8px; transform-origin: 444.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA radar system sends a short electromagnetic pulse toward a target and measures the elapsed time between transmission and reception of the reflected echo.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 435.117px 8px; transform-origin: 435.117px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes this elapsed time in seconds as input and returns the estimated target distance in meters, rounded to two decimal places.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 223.067px 8px; transform-origin: 223.067px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAssume that the pulse travels at the speed of light (c = 299792458 m/s).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(t)\r\n  y = \r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nt = 2e-6; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,299.79))\r\n\r\n%% Test 2\r\nt = 10e-6; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,1498.96))\r\n\r\n%% Test 3\r\nt = 100e-9; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,14.99))\r\n\r\n%% Test 4\r\nt = 1e-3; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,149896.23))\r\n\r\n%% Test 5\r\nt = 0; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,0.00))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T13:52:44.000Z","deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T13:51:57.000Z","updated_at":"2026-07-30T14:11:17.000Z","published_at":"2026-07-29T13:51:57.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\u003eA radar system sends a short electromagnetic pulse toward a target and measures the elapsed time between transmission and reception of the reflected echo.\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\u003eWrite a function that takes this elapsed time in seconds as input and returns the estimated target distance in meters, rounded to two decimal places.\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\u003eAssume that the pulse travels at the speed of light (c = 299792458 m/s).\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":61426,"title":"Range Resolution of a Pulsed Radar","description":"A pulsed radar transmits a rectangular pulse with duration tau seconds. Given the pulse duration, compute the radar range resolution in meters. Assume the speed of light is 299792458 m/s.\r\nRound the result to two decimal places.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 73px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 36.5px; transform-origin: 468.5px 36.5px; \"\u003e\u003cdiv style=\"block-size: 43px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21.5px; text-align: left; transform-origin: 444.5px 21.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 180.883px 8px; transform-origin: 180.883px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA pulsed radar transmits a rectangular pulse with duration \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: 11.55px 8px; transform-origin: 11.55px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 11.55px 8.5px; transform-origin: 11.55px 8.5px; \"\u003etau\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: 229.892px 8px; transform-origin: 229.892px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e seconds. Given the pulse duration, compute the radar range resolution in meters. Assume the speed of light is \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: 53.9px 8px; transform-origin: 53.9px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 53.9px 8.5px; transform-origin: 53.9px 8.5px; \"\u003e299792458 m/s.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 122.142px 8px; transform-origin: 122.142px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRound the result to two decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(tau)\r\n  y = \r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%%\r\nassert(isequal(your_fcn_name(1e-6),149.90))\r\n%%\r\nassert(isequal(your_fcn_name(2e-6),299.79))\r\n%%\r\nassert(isequal(your_fcn_name(5e-7),74.95))\r\n%%\r\nassert(isequal(your_fcn_name(1e-8),1.50))\r\n%%\r\nassert(isequal(your_fcn_name(10e-6),1498.96))\r\n%%\r\nassert(isequal(your_fcn_name(10e-7),149.90))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T10:20:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T07:03:34.000Z","updated_at":"2026-07-30T16:07:38.000Z","published_at":"2026-07-29T07:03:34.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\u003eA pulsed radar transmits a rectangular pulse with duration \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etau\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e seconds. Given the pulse duration, compute the radar range resolution in meters. Assume the speed of light is \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e299792458 m/s.\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\u003eRound the result to two decimal places.\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":44634,"title":"Basic matrix operations using standard MATLAB commands","description":"Create the matrix:\r\n\r\n 1.0e+15 *\r\n\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0001    0.0010    0.0100    0.1000    1.0000\r\n\r\nFind the row vector of all column means\r\n\r\nHint: Use _logspace_ to create the matrix. Avoid looking at the test suite before writing a solution","description_html":"\u003cp\u003eCreate the matrix:\u003c/p\u003e\u003cpre\u003e 1.0e+15 *\u003c/pre\u003e\u003cpre\u003e    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0001    0.0010    0.0100    0.1000    1.0000\u003c/pre\u003e\u003cp\u003eFind the row vector of all column means\u003c/p\u003e\u003cp\u003eHint: Use \u003ci\u003elogspace\u003c/i\u003e to create the matrix. Avoid looking at the test suite before writing a solution\u003c/p\u003e","function_template":"function y = matrix_ls_means()\r\n  y = x;\r\nend","test_suite":"%%\r\ny_correct = mean([logspace(1,5,5);logspace(6,10,5);logspace(11,15,5)]);\r\nassert(isequal(matrix_ls_means(),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2018-05-09T05:37:01.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-09T05:32:41.000Z","updated_at":"2026-07-24T09:39:25.000Z","published_at":"2018-05-09T05:35:49.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\u003eCreate the matrix:\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.0e+15 *\\n\\n    0.0000    0.0000    0.0000    0.0000    0.0000\\n    0.0000    0.0000    0.0000    0.0000    0.0000\\n    0.0001    0.0010    0.0100    0.1000    1.0000]]\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\u003eFind the row vector of all column means\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\u003eHint: Use\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\u003elogspace\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to create the matrix. Avoid looking at the test suite before writing a solution\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":44546,"title":"Calculating the total earnings of a factory","description":"The row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.","description_html":"\u003cp\u003eThe row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.\u003c/p\u003e","function_template":"function earn = earnings(rate, price)\r\n    earn= (); % use your basic knowledge of matrix multiplication\r\nend","test_suite":"%%\r\nrate = [2,5,4];\r\nprice = [8,3,1];\r\ny_correct = 3360;\r\nassert(isequal(earnings(rate,price),3360))\r\n%%\r\nrate = [1,4];\r\nprice = [2,1];\r\ny_correct = 576;\r\nassert(isequal(earnings(rate,price),576))\r\n%%\r\nrate = [6 6 2 3 2 8];\r\nprice = [3 2 4 8 9 5];\r\ny_correct = 11520;\r\nassert(isequal(earnings(rate,price),11520))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-03-31T09:16:35.000Z","updated_at":"2026-05-29T04:26:47.000Z","published_at":"2018-03-31T09:16: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\",\"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\u003eThe row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.\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":52133,"title":"MATLAB Basics: Complex Conjugates","description":"For a given complex number, x, return the complex conjugate, y.","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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: 200.5px 8px; transform-origin: 200.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor a given complex number, x, return the complex conjugate, y.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = compconj(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1+i;\r\ny_correct = 1-i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 1-i;\r\ny_correct = 1+i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 3i;\r\ny_correct = -3i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 7;\r\ny_correct = 7;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 7-13i;\r\ny_correct = 7+13i;\r\nassert(isequal(compconj(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":1231855,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":63,"test_suite_updated_at":"2021-06-28T19:38:20.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-28T14:07:04.000Z","updated_at":"2026-07-19T16:30:14.000Z","published_at":"2021-06-28T14:07:36.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\u003eFor a given complex number, x, return the complex conjugate, y.\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":44670,"title":"Basic Quadratic Equation","description":"Create the equation:\r\n\r\ny=(3x)^2+(5x)+35\r\nand compute y for various values of x","description_html":"\u003cp\u003eCreate the equation:\u003c/p\u003e\u003cp\u003ey=(3x)^2+(5x)+35\r\nand compute y for various values of x\u003c/p\u003e","function_template":"function y = quad1(x)\r\n\r\nend","test_suite":"%%\r\nx = -3;\r\ny_correct = 101;\r\nassert(isequal(quad1(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 285;\r\nassert(isequal(quad1(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":93,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-30T10:55:15.000Z","updated_at":"2026-07-24T14:07:04.000Z","published_at":"2018-05-30T10:55:15.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\u003eCreate the equation:\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=(3x)^2+(5x)+35 and compute y for various values of x\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":46763,"title":"Double the length of the vector","description":null,"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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ex=[1 2 3 4]\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ey=[1 0 2 0 3 0 4 0]\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAdd zeros in between the data\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function double= your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [5 4 3 2];\r\ny_correct = [5 0 4 0 3 0 2 0];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx= [1 2 3 4];\r\ny_correct=[1 0 2 0 3 0 4 0];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":628208,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-16T15:49:54.000Z","updated_at":"2026-05-30T17:05:29.000Z","published_at":"2020-10-16T15:57:17.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\u003ex=[1 2 3 4]\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=[1 0 2 0 3 0 4 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdd zeros in between the data\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":58254,"title":"Find the mean of the magic x","description":"Given a x term, find the magic x, then find the mean/average of any one row or column.","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.5px 10.5px; transform-origin: 406.5px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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: 383.494px 10.5px; text-align: left; transform-origin: 383.503px 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven a x term, find the magic x, then find the mean/average of any one row or column.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = mean_magic(x)\r\ny = x;\r\n","test_suite":"%%\r\nx = 5;\r\ny_correct = 13;\r\nassert(isequal(mean_magic(x),y_correct))\r\n%%\r\nx = 15;\r\ny_correct = 113;\r\nassert(isequal(mean_magic(x),y_correct))\r\n%%\r\nx = 12;\r\ny_correct = 72.5;\r\nassert(isequal(mean_magic(x),y_correct))\r\n%%\r\nx = 22;\r\ny_correct = 242.5;\r\nassert(isequal(mean_magic(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3227359,"edited_by":3227359,"edited_at":"2023-05-03T16:41:31.000Z","deleted_by":null,"deleted_at":null,"solvers_count":24,"test_suite_updated_at":"2023-05-03T16:41:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2023-05-03T14:54:47.000Z","updated_at":"2026-06-04T00:28:19.000Z","published_at":"2023-05-03T14:54:47.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\u003eGiven a x term, find the magic x, then find the mean/average of any one row or column.\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":43566,"title":"Create vector as shown in test cases","description":"Create vector as shown in test cases","description_html":"\u003cp\u003eCreate vector as shown in test cases\u003c/p\u003e","function_template":"function y = vec_rev(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 100;\r\ny_correct = 100:-1:0;\r\nassert(isequal(vec_rev(x),y_correct))\r\n\r\n%%\r\nx = 45;\r\ny_correct = 45:-1:0;\r\nassert(isequal(vec_rev(x),y_correct))\r\n\r\n%%\r\nx = 20;\r\ny_correct = 20:-1:0;\r\nassert(isequal(vec_rev(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":254,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-16T14:53:00.000Z","updated_at":"2026-04-13T13:50:37.000Z","published_at":"2016-10-16T14:53: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\",\"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\u003eCreate vector as shown in test cases\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":43333,"title":"Save variables","description":"a=[1]\r\n\r\nSave variable a that is located in workspace into current folder. File name should be 'a.mat'","description_html":"\u003cp\u003ea=[1]\u003c/p\u003e\u003cp\u003eSave variable a that is located in workspace into current folder. File name should be 'a.mat'\u003c/p\u003e","function_template":"function y = savevar(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\nsavevar(a)\r\nii=ls('a.mat')\r\nassert(~isempty(ii))\r\n\r\n%%\r\nclear\r\nload a\r\nassert(a==1)","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2016-10-15T04:35:08.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-11T14:13:40.000Z","updated_at":"2026-02-06T12:20:54.000Z","published_at":"2016-10-11T14:13: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\u003ea=[1]\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\u003eSave variable a that is located in workspace into current folder. File name should be 'a.mat'\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":43156,"title":"Find x in provided equation!","description":"x^2-2*x+1=0\r\n\r\nThis polynomial can be expressed by using each term's coefficients, such as\r\n\r\n[1 -2 1].\r\n\r\nUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \"roots\")","description_html":"\u003cp\u003ex^2-2*x+1=0\u003c/p\u003e\u003cp\u003eThis polynomial can be expressed by using each term's coefficients, such as\u003c/p\u003e\u003cp\u003e[1 -2 1].\u003c/p\u003e\u003cp\u003eUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \"roots\")\u003c/p\u003e","function_template":"function y = solvepol(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 -2 1];\r\ny_correct = [1;1];\r\nassert(isequal(solvepol(x),y_correct))\r\n\r\n%%\r\nx = [1 -3 2];\r\ny_correct = [2;1];\r\nassert(isequal(solvepol(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":121,"test_suite_updated_at":"2016-10-21T06:37:13.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T13:48:30.000Z","updated_at":"2026-04-08T13:10:52.000Z","published_at":"2016-10-07T13:48:51.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\u003ex^2-2*x+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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis polynomial can be expressed by using each term's coefficients, such as\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[1 -2 1].\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\u003eUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \\\"roots\\\")\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":2875,"title":"Find difference of two set as per example","description":"Find difference of two set as per example\r\n\r\nSay x=[1:5] and y=[2:6]\r\n\r\nthen, set_diff(x,y) should give output[1] and set_diff(y,x) should give output[6]","description_html":"\u003cp\u003eFind difference of two set as per example\u003c/p\u003e\u003cp\u003eSay x=[1:5] and y=[2:6]\u003c/p\u003e\u003cp\u003ethen, set_diff(x,y) should give output[1] and set_diff(y,x) should give output[6]\u003c/p\u003e","function_template":"function jj = set_diff(x,y)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1:5;\r\ny = 2:6;\r\ny_correct = 1;\r\nassert(isequal(set_diff(x,y) ,y_correct))\r\n%%\r\nx = 1:5;\r\ny = 2:6;\r\ny_correct = 6;\r\nassert(isequal(set_diff(y,x) ,y_correct))\r\n%%\r\nx=2:4;\r\ny=4:2;\r\ny_correct = [2 3 4];\r\nassert(isequal(set_diff(x,y) ,y_correct))\r\n%%\r\nx=0:4;\r\ny=2:4;\r\ny_correct = [0 1];\r\nassert(isequal(set_diff(x,y) ,y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":88,"test_suite_updated_at":"2015-01-24T08:02:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-24T07:58:49.000Z","updated_at":"2026-02-06T15:56:55.000Z","published_at":"2015-01-24T08:02:52.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\u003eFind difference of two set as per example\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\u003eSay x=[1:5] and y=[2: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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen, set_diff(x,y) should give output[1] and set_diff(y,x) should give output[6]\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":61195,"title":"Plus Cross Mandala","description":"Create a symmetrical plus (+) shaped pattern centered in an N×N matrix.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 383px 10.5px; text-align: left; transform-origin: 383px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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=\"\"\u003eCreate a symmetrical plus (+) shaped pattern centered in an N×N matrix.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = plus_cross(N)\r\ny = zeros(N);\r\nend\r\n","test_suite":"%% N = 5\r\nN = 5;\r\ny_correct = [0 0 1 0 0;\r\n             0 0 1 0 0;\r\n             1 1 1 1 1;\r\n             0 0 1 0 0;\r\n             0 0 1 0 0];\r\nassert(isequal(plus_cross(N),y_correct))\r\n\r\n%% N = 7\r\nN = 7;\r\ny_correct = [ 0     0     0     1     0     0     0\r\n              0     0     0     1     0     0     0\r\n              0     0     0     1     0     0     0\r\n              1     1     1     1     1     1     1\r\n              0     0     0     1     0     0     0\r\n              0     0     0     1     0     0     0\r\n              0     0     0     1     0     0     0];\r\nassert(isequal(plus_cross(N),y_correct))\r\n\r\n% N = 9\r\nN = 9;\r\ny_correct = [0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             1     1     1     1     1     1     1     1     1\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0];\r\nassert(isequal(plus_cross(N),y_correct))\r\n\r\n% N = 11\r\nN = 11;\r\ny_correct = [0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            1     1     1     1     1     1     1     1     1     1     1\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0];\r\nassert(isequal(plus_cross(N),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":2305225,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-02-02T10:12:11.000Z","updated_at":"2026-05-24T19:09:15.000Z","published_at":"2026-02-02T10:12:11.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\u003eCreate a symmetrical plus (+) shaped pattern centered in an N×N matrix.\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":42321,"title":"given number is power of n or not?","description":"Check weather The input is power of n or not?\r\nfor example \r\n\r\nx=8,n=2 --\u003e true\r\nx=6,n=2 --\u003e false","description_html":"\u003cp\u003eCheck weather The input is power of n or not?\r\nfor example\u003c/p\u003e\u003cp\u003ex=8,n=2 --\u0026gt; true\r\nx=6,n=2 --\u0026gt; false\u003c/p\u003e","function_template":"function y = Powerof(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 16; n=2\r\ny_correct = 'true';\r\nassert(isequal(Powerof(x,n),y_correct))\r\n\r\n%%\r\nx = 14; n=2\r\ny_correct = 'false';\r\nassert(isequal(Powerof(x,n),y_correct))\r\n\r\n%%\r\nx = 64; n=4\r\ny_correct = 'true';\r\nassert(isequal(Powerof(x,n),y_correct))\r\n\r\n%%\r\nx = 625; n=5\r\ny_correct = 'true';\r\nassert(isequal(Powerof(x,n),y_correct))\r\n\r\n%%\r\nx = 15; n=5\r\ny_correct = 'false';\r\nassert(isequal(Powerof(x,n),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":44104,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":84,"test_suite_updated_at":"2015-05-20T06:33:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-05-19T10:32:51.000Z","updated_at":"2026-03-04T13:49:11.000Z","published_at":"2015-05-19T10:32:51.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\u003eCheck weather The input is power of n or not? for example\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\u003ex=8,n=2 --\u0026gt; true x=6,n=2 --\u0026gt; false\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":43314,"title":"Change matrix to vector","description":"Vector is a matrix whose size is 1 x n or n x 1.\r\n\r\nChange matrix to vector.\r\n\r\n  x =\r\n  \r\n       4     3\r\n       5     1\r\n       5     1\r\n\r\ninput x should change to output y.\r\n\r\n  y =\r\n  \r\n       4\r\n       5\r\n       5\r\n       3\r\n       1\r\n       1","description_html":"\u003cp\u003eVector is a matrix whose size is 1 x n or n x 1.\u003c/p\u003e\u003cp\u003eChange matrix to vector.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex =\r\n\u003c/pre\u003e\u003cpre\u003e       4     3\r\n       5     1\r\n       5     1\u003c/pre\u003e\u003cp\u003einput x should change to output y.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey =\r\n\u003c/pre\u003e\u003cpre\u003e       4\r\n       5\r\n       5\r\n       3\r\n       1\r\n       1\u003c/pre\u003e","function_template":"function y = rearrange(x)\r\n  y =\r\nend","test_suite":"%%\r\nx = [  2     3\r\n       3     4\r\n       3     4];\r\ny_correct = [2;3;3;3;4;4];\r\nassert(isequal(rearrange(x),y_correct))\r\n\r\n%%\r\nx = [  4     3\r\n       5     1\r\n       5     1];\r\ny_correct = [4;5;5;3;1;1];\r\nassert(isequal(rearrange(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":204,"test_suite_updated_at":"2016-10-15T04:42:30.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T14:39:54.000Z","updated_at":"2026-02-11T18:22:52.000Z","published_at":"2016-10-10T14:39:54.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\u003eVector is a matrix whose size is 1 x n or n x 1.\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\u003eChange matrix to vector.\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 =\\n\\n       4     3\\n       5     1\\n       5     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\u003einput x should change to output y.\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[y =\\n\\n       4\\n       5\\n       5\\n       3\\n       1\\n       1]]\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":1258,"title":"Create matrix of replicated elements","description":"Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. \r\n\r\nExample:\r\n Input: repl_mat(2, 2, 5)\r\n Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];","description_html":"\u003cp\u003eGiven an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x.\u003c/p\u003e\u003cp\u003eExample:\r\n Input: repl_mat(2, 2, 5)\r\n Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];\u003c/p\u003e","function_template":"function y = repl_mat(x, m, n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\nm = 197;\r\nn = 535;\r\ny_correct = ones(m, n);\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = 0;\r\nm = 458;\r\nn = 535;\r\ny_correct = zeros(m, n);\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = 2;\r\nm = 1;\r\nn = 1;\r\ny_correct = 2;\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = -1;\r\nm = 1;\r\nn = 2;\r\ny_correct = [-1 -1];\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = 1.5;\r\nm = 2;\r\nn = 2;\r\ny_correct = [1.5 1.5; 1.5 1.5];\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = '1';\r\nm = 1;\r\nn = 3;\r\ny_correct = ['1' '1' '1'];\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":402,"test_suite_updated_at":"2013-02-10T21:51:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-10T21:46:34.000Z","updated_at":"2026-07-24T13:35:36.000Z","published_at":"2013-02-10T21:51:33.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\u003eGiven an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x.\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: Input: repl_mat(2, 2, 5) Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];\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":44654,"title":"convert the number to binary format \u0026 count digits","description":"Convert the given number to the corresponding binary format and count the number of digits in that binary number","description_html":"\u003cp\u003eConvert the given number to the corresponding binary format and count the number of digits in that binary number\u003c/p\u003e","function_template":"function y = dec_2_bin(x)\r\n \r\nend","test_suite":"%%\r\nx = 23;\r\ny_correct = 5;\r\nassert(isequal(dec_2_bin(x),y_correct))\r\n\r\n%%\r\nx = 234;\r\ny_correct = 8;\r\nassert(isequal(dec_2_bin(x),y_correct))\r\n\r\n%%\r\nx = 22;\r\ny_correct = 5;\r\nassert(isequal(dec_2_bin(x),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny_correct = 2;\r\nassert(isequal(dec_2_bin(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-25T11:50:28.000Z","updated_at":"2026-05-30T00:32:49.000Z","published_at":"2018-05-25T11:50:28.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\u003eConvert the given number to the corresponding binary format and count the number of digits in that binary number\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":2818,"title":"Remove and Sort","description":"Given a randomized array n, sort it and remove all odd integers.\r\n\r\nn=5\r\n\r\ny = [2 4]","description_html":"\u003cp\u003eGiven a randomized array n, sort it and remove all odd integers.\u003c/p\u003e\u003cp\u003en=5\u003c/p\u003e\u003cp\u003ey = [2 4]\u003c/p\u003e","function_template":"function x = rmv_srt(n)\r\nx=randperm(n)\r\n  \r\ny = x;\r\n\r\nend","test_suite":"%%\r\nn=10\r\nx = randperm(n);\r\ny_correct = [2 4 6 8 10];\r\nassert(isequal(rmv_srt(n),y_correct))\r\n%%\r\nn=25\r\nx = randperm(n);\r\ny_correct = [2 4 6 8 10 12 14 16 18 20 22 24];\r\nassert(isequal(rmv_srt(n),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":33703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":110,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-09T01:04:50.000Z","updated_at":"2026-02-27T14:06:01.000Z","published_at":"2015-01-09T01:06: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\",\"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\u003eGiven a randomized array n, sort it and remove all odd integers.\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\u003en=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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = [2 4]\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":43552,"title":"Calculate solution of given polynomial","description":"For example,\r\n\r\ny=function([3 -2 -4])\r\n\r\nIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\r\n\r\ny=[1.5352; -0.8685]","description_html":"\u003cp\u003eFor example,\u003c/p\u003e\u003cp\u003ey=function([3 -2 -4])\u003c/p\u003e\u003cp\u003eIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\u003c/p\u003e\u003cp\u003ey=[1.5352; -0.8685]\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [3 -2 -4];\r\ny_correct = [  1.5352\r\n              -0.8685];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx = [1 2 1];\r\ny_correct = [-1;-1];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx = [1 2 2];\r\ny_correct = [  -1.0000 + 1.0000i\r\n               -1.0000 - 1.0000i];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":"2016-10-15T04:16:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-14T11:53:24.000Z","updated_at":"2026-02-17T08:26:30.000Z","published_at":"2016-10-14T11:53:24.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\u003eFor example,\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=function([3 -2 -4])\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\u003eIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\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=[1.5352; -0.8685]\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":61270,"title":"Sum all elements of a vector or matrix without using  some built in functions","description":"Write a function that computes the sum of all elements of the input array v without using the following built-in function:\r\nsum, trace, mean, norm, diag, numel, size, ans,width,height\r\nThe input v may be a vector or a matrix of any size.\r\nIf the input is empty, the function must return 0.\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 141px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 70.5px; transform-origin: 468.5px 70.5px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 362.775px 8px; transform-origin: 362.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that computes the sum of all elements of the input array v without using the following built-in function:\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 184.75px 8px; transform-origin: 184.75px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esum, trace, mean, norm, diag, numel, size, ans,width,height\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 158.675px 8px; transform-origin: 158.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe input v may be a vector or a matrix of any size.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 145.317px 8px; transform-origin: 145.317px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the input is empty, the function must return 0.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'sum')))\r\nassert(isempty(strfind(filetext, 'mean')))\r\nassert(isempty(strfind(filetext, 'norm')))\r\nassert(isempty(strfind(filetext, 'diag')))\r\nassert(isempty(strfind(filetext, 'numel')))\r\nassert(isempty(strfind(filetext, 'size')))\r\nassert(isempty(strfind(filetext, 'trace')))\r\nassert(isempty(strfind(filetext, 'width')))\r\nassert(isempty(strfind(filetext, 'height')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\n%%\r\nx=[1 2 55;5 33 11];\r\ny_correct = 107;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx=[1 2 3 10];\r\ny_correct = 16;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx=[2 12 44 66 77;11 21 44 90 55];\r\ny_correct=422;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\n%%\r\nx=1:150;\r\ny_correct = 11325;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx=[1;4;7;9;101];\r\ny_correct=122;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx=[];\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-03-05T10:15:22.000Z","updated_at":"2026-06-06T17:53:57.000Z","published_at":"2026-03-05T10:15:21.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\u003eWrite a function that computes the sum of all elements of the input array v without using the following built-in function:\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\u003esum, trace, mean, norm, diag, numel, size, ans,width,height\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\u003eThe input v may be a vector or a matrix of any size.\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\u003eIf the input is empty, the function must return 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\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\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":44664,"title":"function to compute root mean square of first nn positive odd integers","description":"Write a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.","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: 84px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 42px; transform-origin: 407px 42px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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 42px; text-align: left; transform-origin: 384px 42px; 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: 367px 8px; transform-origin: 367px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function orms = odd_rms(nn)\r\n  \r\nend","test_suite":"%%\r\nnn = 3;\r\norms_correct = 3.4156\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)\r\n\r\n%%\r\nnn = 10;\r\norms_correct = 11.5325\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)\r\n\r\n%%\r\nnn = 1;\r\norms_correct = 1\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":"2021-12-31T17:41:47.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T15:13:46.000Z","updated_at":"2026-05-30T00:36:27.000Z","published_at":"2018-05-29T15:13:46.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\u003eWrite a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.\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":43134,"title":"Vector Multiplication ","description":"Vector Multiplication of three matrix as shown in test cases. ","description_html":"\u003cp\u003eVector Multiplication of three matrix as shown in test cases.\u003c/p\u003e","function_template":"function r = vec_mul(x,y,z)\r\n  r = x*y*z;\r\nend","test_suite":"%%\r\nx=[2 5];\r\ny=[5 6];\r\nz=[5 7];\r\ny_correct = [  50   210];\r\nassert(isequal(vec_mul(x,y,z),y_correct))\r\n\r\n%%\r\nx = [1 1 1 ];\r\ny=[1 1 1 ];\r\nz=[1 1 1];\r\ny_correct = [1 1 1];\r\nassert(isequal(vec_mul(x,y,z),y_correct))\r\n%%\r\nx = [1 2];\r\ny=[1 2];\r\nz=[1 2];\r\ny_correct = [1 8];\r\nassert(isequal(vec_mul(x,y,z),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny=1;\r\nz=1;\r\ny_correct = 1;\r\nassert(isequal(vec_mul(x,y,z),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":343,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T03:59:04.000Z","updated_at":"2026-07-04T11:42:18.000Z","published_at":"2016-10-07T03:59: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\",\"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\u003eVector Multiplication of three matrix as shown in test cases.\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":42592,"title":"Create cell array of strings","description":"Convert the input to a cell array, but only if necessary.\r\n\r\nIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.","description_html":"\u003cp\u003eConvert the input to a cell array, but only if necessary.\u003c/p\u003e\u003cp\u003eIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.\u003c/p\u003e","function_template":"function C = str2cell(S)\r\n  C = '';\r\nend","test_suite":"%%\r\nS = 'Testing, testing, 1, 2, 3';\r\nassert(isequal(str2cell(S),{S}))\r\n\r\n%%\r\nS = {'I','love','MATLAB'};\r\nassert(isequal(str2cell(S),S))\r\n\r\n%%\r\nS = datestr(now);\r\nassert(isequal(str2cell(S),{S}))\r\n\r\n%%\r\nfor ii=1:100\r\n  S = char(randi([97,122],1,100));\r\n  assert(isequal(str2cell(S),{S}))\r\nend\r\n\r\n%%\r\nfor ii=1:100\r\n  S = num2cell(char(randi([97,122],100,1)));\r\n  assert(isequal(str2cell(S),S))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-09T21:15:00.000Z","updated_at":"2026-05-28T13:57:38.000Z","published_at":"2015-09-09T21:15: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\",\"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\u003eConvert the input to a cell array, but only if necessary.\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\u003eIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.\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":42844,"title":"Detect pair of equal values in a Matrix","description":"A 2D matrix of 2 rows and N columns with random integer numbers.\r\n\r\n  \r\n    A = [3 1 2 4 6 6 7;\r\n\r\n         7 3 2 1 5 2 4]\r\n  \r\n\r\nin this Matrix, 3rd column has a pair of the same number.\r\n\r\nFunction return will be true/false.","description_html":"\u003cp\u003eA 2D matrix of 2 rows and N columns with random integer numbers.\u003c/p\u003e\u003cpre\u003e    A = [3 1 2 4 6 6 7;\u003c/pre\u003e\u003cpre\u003e         7 3 2 1 5 2 4]\u003c/pre\u003e\u003cp\u003ein this Matrix, 3rd column has a pair of the same number.\u003c/p\u003e\u003cp\u003eFunction return will be true/false.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [3 1 2 4 6 6 7;\r\n         7 3 2 1 5 2 4];\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [3 1 2 4 6 6 7;\r\n         7 3 6 1 5 2 4];\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":14921,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":74,"test_suite_updated_at":"2016-05-01T18:21:08.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-05-01T18:18:47.000Z","updated_at":"2026-02-26T12:22:37.000Z","published_at":"2016-05-01T18:21:08.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\u003eA 2D matrix of 2 rows and N columns with random integer numbers.\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 1 2 4 6 6 7;\\n\\n         7 3 2 1 5 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\u003ein this Matrix, 3rd column has a pair of the same 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\u003eFunction return will be true/false.\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":43308,"title":"Calculate some equation","description":"Using given inputs x and z, make two outputs that are\r\n\r\n y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\r\n\r\n y2 = x^z - z^x + (x/z)^2 - (z/x)^2\r\n\r\n","description_html":"\u003cp\u003eUsing given inputs x and z, make two outputs that are\u003c/p\u003e\u003cpre\u003e y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\u003c/pre\u003e\u003cpre\u003e y2 = x^z - z^x + (x/z)^2 - (z/x)^2\u003c/pre\u003e","function_template":"function [y1 y2] = calculate_eq(x,z)\r\n  y1 =\r\n  y2 =  \r\nend","test_suite":"%%\r\nx = 1;\r\nz = 1;\r\ny1=14.2000\r\ny2=0\r\n\r\n[y11,y22]=calculate_eq(x,z)\r\nassert( abs(y1-y11)+abs(y2-y22)\u003c0.001 )\r\n\r\n\r\n%%\r\nx = 2;\r\nz = 1;\r\ny1= 55.7000\r\ny2=4.7500\r\n\r\n[y11,y22]=calculate_eq(x,z)\r\nassert( abs(y1-y11)+abs(y2-y22)\u003c0.001 )\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":"2016-10-15T04:52:37.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T13:09:03.000Z","updated_at":"2026-02-18T21:55:46.000Z","published_at":"2016-10-10T13:09:03.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\u003eUsing given inputs x and z, make two outputs that are\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[ y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\\n\\n y2 = x^z - z^x + (x/z)^2 - (z/x)^2]]\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":43174,"title":"Change string to number","description":"Change given string to number. (hint: there is already function)\r\n\r\nChanging from ['1234'] to [1234] is one of example","description_html":"\u003cp\u003eChange given string to number. (hint: there is already function)\u003c/p\u003e\u003cp\u003eChanging from ['1234'] to [1234] is one of example\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = '1';\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":230,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T18:22:17.000Z","updated_at":"2026-07-24T17:45:00.000Z","published_at":"2016-10-07T18:22:17.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\u003eChange given string to number. (hint: there is already function)\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\u003eChanging from ['1234'] to [1234] is one of example\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":44548,"title":"ASCII sum of phrases","description":"Find the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array:\r\n[77   121    32   110    97   109   101    32   105   115    32   116   101   115   116] i.e. 1379","description_html":"\u003cp\u003eFind the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array:\r\n[77   121    32   110    97   109   101    32   105   115    32   116   101   115   116] i.e. 1379\u003c/p\u003e","function_template":"function y = str_to_number(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'Tilda : ~';\r\ny_correct = 742;\r\nassert(isequal(str_to_number(x),742))\r\n%%\r\nx = 'Practise more';\r\ny_correct = 1294;\r\nassert(isequal(str_to_number(x),1294))\r\n%%\r\nx = '1 last test';\r\ny_correct = 997;\r\nassert(isequal(str_to_number(x),997))\r\n%%\r\nx = 'OK, Definitely the last!';\r\ny_correct = 997;\r\nassert(isequal(str_to_number(x),2121))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-02T16:01:56.000Z","updated_at":"2026-05-29T04:26:48.000Z","published_at":"2018-04-02T16:01:56.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\u003eFind the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array: [77 121 32 110 97 109 101 32 105 115 32 116 101 115 116] i.e. 1379\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":43488,"title":"Print true if ","description":"all elements are larger than 5\r\n\r\n  a=[1 3 5 8 6];\r\n  b=[6 6 6 6 6];\r\n\r\nfunction(a) should be false, and function(b) will be true.\r\n","description_html":"\u003cp\u003eall elements are larger than 5\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea=[1 3 5 8 6];\r\nb=[6 6 6 6 6];\r\n\u003c/pre\u003e\u003cp\u003efunction(a) should be false, and function(b) will be true.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [6 6 6 6 6 6 6 6 ];\r\ny_correct = true;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [6 6 6 1 6 6 6 6 ];\r\ny_correct = false;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [6 6 9 6 6 6 9 1 ];\r\ny_correct = false;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":153,"test_suite_updated_at":"2016-10-15T04:19:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-12T13:22:38.000Z","updated_at":"2026-07-24T17:51:14.000Z","published_at":"2016-10-12T13:22:38.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\u003eall elements are larger than 5\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 3 5 8 6];\\nb=[6 6 6 6 6];]]\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\u003efunction(a) should be false, and function(b) will be true.\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":42499,"title":"Is it column vector?","description":"Is it column vector? \r\n\r\nCheck vector for column vector without using iscolumn function. ","description_html":"\u003cp\u003eIs it column vector?\u003c/p\u003e\u003cp\u003eCheck vector for column vector without using iscolumn function.\u003c/p\u003e","function_template":"function y = iscol(x)\r\n  y = x;\r\nend","test_suite":"%%\r\n\r\nfiletext = fileread('iscol.m');\r\nassert(isempty(strfind(filetext, 'iscolumn(')),'mean forbidden')\r\nassert(isempty(strfind(filetext, 'iscolumn (')),'mean forbidden')\r\nassert(isempty(strfind(filetext, '...')),'... forbidden')\r\n\r\n%%\r\nx = [2 3];\r\ny_correct = 0;\r\nassert(isequal(iscol(x),y_correct))\r\n\r\n%%\r\nx = [2 3]';\r\ny_correct = 1;\r\nassert(isequal(iscol(x),y_correct))\r\n\r\n%%\r\nx = [1];\r\ny_correct = 1;\r\nassert(isequal(iscol(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":209,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-08T09:55:22.000Z","updated_at":"2026-02-16T12:27:17.000Z","published_at":"2015-08-08T09:55:22.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\u003eIs it column 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\u003eCheck vector for column vector without using iscolumn function.\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":46908,"title":"Product of elements in a column","description":null,"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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eif x=[1 2 3\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e        3 4 5\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e        1 2 1] do the product of all the elements in a column such that your answer should be y=[3 16 15]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx =[1 2 3;3 4 5;1 2 1];\r\ny_correct = [3 16 15];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx =[1 8 9 4;1 26 7 5];\r\ny_correct = [1 208 63 20];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx =[10 20;30 40];\r\ny_correct = [300 800];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx =[10 30;20 40];\r\ny_correct = [200 1200];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":628208,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2020-10-23T09:06:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-18T10:24:59.000Z","updated_at":"2026-05-31T17:42:26.000Z","published_at":"2020-10-23T09:06:17.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\u003eif x=[1 2 3\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        3 4 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e        1 2 1] do the product of all the elements in a column such that your answer should be y=[3 16 15]\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":42324,"title":"Accessing value of variable whose name is stored in another variable as string.","description":"Accessing value of variable whose name is stored in another variable as string.\r\nfor example:\r\nvar1=n;\r\nvar2='var1';  %Assigning var1 as a string\r\nvar3= var2;  %want to give var1 value to var3 with out using var1 variable.\r\n\r\n% do not give var3=n or var3=var1l","description_html":"\u003cp\u003eAccessing value of variable whose name is stored in another variable as string.\r\nfor example:\r\nvar1=n;\r\nvar2='var1';  %Assigning var1 as a string\r\nvar3= var2;  %want to give var1 value to var3 with out using var1 variable.\u003c/p\u003e\u003cp\u003e% do not give var3=n or var3=var1l\u003c/p\u003e","function_template":"function var3 = varaccess(n)\r\n  var3='var1';\r\nend","test_suite":"%%\r\nn = 10;\r\nvar3_correct = 10;\r\nassert(isequal(varaccess(n),var3_correct))\r\n\r\n%%\r\nn = 30;\r\nvar3_correct = 30;\r\nassert(isequal(varaccess(n),var3_correct))\r\n\r\n%%\r\nn = 0.6;\r\nvar3_correct = 0.6;\r\nassert(isequal(varaccess(n),var3_correct))\r\n\r\n%%\r\nn = 500;\r\nvar3_correct = 500;\r\nassert(isequal(varaccess(n),var3_correct))\r\n\r\n%%\r\nn = 7.8;\r\nvar3_correct = 7.8;\r\nassert(isequal(varaccess(n),var3_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":44104,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":50,"test_suite_updated_at":"2015-05-21T12:08:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-05-21T11:59:24.000Z","updated_at":"2026-02-25T10:45:16.000Z","published_at":"2015-05-21T11:59:38.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\u003eAccessing value of variable whose name is stored in another variable as string. for example: var1=n; var2='var1'; %Assigning var1 as a string var3= var2; %want to give var1 value to var3 with out using var1 variable.\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% do not give var3=n or var3=var1l\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":3107,"title":"Try and Catch Simple Example","description":"Try and Catch Simple Example \r\n\r\n\u003chttp://in.mathworks.com/help/matlab/ref/try.html Example\u003e \r\n\r\nVector x=[1 4 6 8 10];\r\n\r\nCreate a function using try and catch, if user asks index 0 or negative or more than the length, then display zero otherwise value of x. \r\n","description_html":"\u003cp\u003eTry and Catch Simple Example\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://in.mathworks.com/help/matlab/ref/try.html\"\u003eExample\u003c/a\u003e\u003c/p\u003e\u003cp\u003eVector x=[1 4 6 8 10];\u003c/p\u003e\u003cp\u003eCreate a function using try and catch, if user asks index 0 or negative or more than the length, then display zero otherwise value of x.\u003c/p\u003e","function_template":"function y = trcatch(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 4 6 8 10];\r\nn=1;\r\ny_correct = 1;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n%% \r\nfiletext = fileread('trcatch.m');\r\nassert(~isempty(strfind(filetext, 'try')),'try missing')\r\nassert(~isempty(strfind(filetext, 'catch')),'Catch missing')\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=0;\r\ny_correct = 0;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=6;\r\ny_correct = 0;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=5;\r\ny_correct = 10;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=-25;\r\ny_correct = 0;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=3;\r\ny_correct = 6;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":135,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-03-23T09:12:50.000Z","updated_at":"2026-02-17T08:52:20.000Z","published_at":"2015-03-23T09:12:50.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\u003eTry and Catch Simple Example\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:hyperlink w:docLocation=\\\"http://in.mathworks.com/help/matlab/ref/try.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\u003eVector x=[1 4 6 8 10];\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\u003eCreate a function using try and catch, if user asks index 0 or negative or more than the length, then display zero otherwise value of x.\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":42593,"title":"Create cell array of numeric arrays","description":"Convert the input to a cell array, but only if necessary.\r\n\r\nIf the input is a numeric array, return a 1-by-1 cell array containing the input. If the input is a cell array of numeric arrays, return the input unaltered.","description_html":"\u003cp\u003eConvert the input to a cell array, but only if necessary.\u003c/p\u003e\u003cp\u003eIf the input is a numeric array, return a 1-by-1 cell array containing the input. If the input is a cell array of numeric arrays, return the input unaltered.\u003c/p\u003e","function_template":"function y = cellnum(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = rand;\r\nassert(isequal(cellnum(x),{x}))\r\n\r\n%%\r\nfor ii=1:10\r\n  x = rand(1,randi([2 100]));\r\n  assert(isequal(cellnum(x),{x}))\r\nend\r\n\r\n%%\r\nfor ii=1:10\r\n  x = rand(randi([2 100]),1);\r\n  assert(isequal(cellnum(x),{x}))\r\nend\r\n\r\n%%\r\nfor ii=2:10\r\n  x = magic(ii);\r\n  assert(isequal(cellnum(x),{x}))\r\nend\r\n\r\n%%\r\nfor ii=1:10\r\n  x = num2cell(rand(1,randi(100)));\r\n  assert(isequal(cellnum(x),x))\r\nend\r\n\r\n%%\r\nx = mat2cell(hankel(1:100),[10*ones(1,10)],[10*ones(1,10)]);\r\nassert(isequal(cellnum(x(:)),x(:)))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":46,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-09T21:46:25.000Z","updated_at":"2026-05-28T13:57:39.000Z","published_at":"2015-09-09T21:46:25.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\u003eConvert the input to a cell array, but only if necessary.\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\u003eIf the input is a numeric array, return a 1-by-1 cell array containing the input. If the input is a cell array of numeric arrays, return the input unaltered.\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":1667,"title":"What number has this problem?","description":"This problem is added because it is problem number *???* in the \"Community\" problems section.\r\n\r\n\u003chttp://www.mathworks.de/matlabcentral/cody/?sort=\u0026term=group%3ACommunity A lots of problems here!\u003e\r\n\r\n\r\nThank you, Community!\r\n\r\nand... \r\n\r\nThank you Matlab!!","description_html":"\u003cp\u003eThis problem is added because it is problem number \u003cb\u003e???\u003c/b\u003e in the \"Community\" problems section.\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.de/matlabcentral/cody/?sort=\u0026term=group%3ACommunity\"\u003eA lots of problems here!\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThank you, Community!\u003c/p\u003e\u003cp\u003eand...\u003c/p\u003e\u003cp\u003eThank you Matlab!!\u003c/p\u003e","function_template":"function nr = celebrating_Problem()\r\n  nr = ???;\r\nend","test_suite":"%%\r\nweCelebrateProblemNumber = 1000;\r\nassert(isequal(celebrating_Problem(),weCelebrateProblemNumber))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":3038,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":405,"test_suite_updated_at":"2013-06-20T22:47:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-20T22:38:15.000Z","updated_at":"2026-05-05T18:09:22.000Z","published_at":"2013-06-20T22:47: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\u003eThis problem is added because it is problem number\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\u003e???\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in the \\\"Community\\\" problems section.\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:hyperlink w:docLocation=\\\"http://www.mathworks.de/matlabcentral/cody/?sort=\u0026amp;term=group%3ACommunity\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eA lots of problems here!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\u003eThank you, Community!\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\u003eand...\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\u003eThank you Matlab!!\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":2604,"title":"Gamma Function ","description":"Evaluate the \u003chttp://en.wikipedia.org/wiki/Gamma_function/ Gamma Function\u003e.\r\n\r\n Gamma_val(0)   = Inf\r\n Gamma_val(1.2) = 0.9182","description_html":"\u003cp\u003eEvaluate the \u003ca href = \"http://en.wikipedia.org/wiki/Gamma_function/\"\u003eGamma Function\u003c/a\u003e.\u003c/p\u003e\u003cpre\u003e Gamma_val(0)   = Inf\r\n Gamma_val(1.2) = 0.9182\u003c/pre\u003e","function_template":"function y = Gamma_val(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(Gamma_val(x),y_correct))\r\n%%\r\nx = 0;\r\ny_correct = Inf;\r\nassert(isequal(Gamma_val(x),y_correct))\r\n%%\r\nx = 1.2;\r\ny_correct = 0.9182;\r\nassert(abs(Gamma_val(x)-y_correct)\u003c0.0001)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":120,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-09-26T13:31:41.000Z","updated_at":"2026-02-20T14:14:09.000Z","published_at":"2014-09-26T13:31:41.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\u003eEvaluate 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=\\\"http://en.wikipedia.org/wiki/Gamma_function/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGamma Function\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Gamma_val(0)   = Inf\\n Gamma_val(1.2) = 0.9182]]\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":61030,"title":"The MATLAB Treasure Hunt – Decode the First Clue Hidden in a Jumbled Sequence of Numbers","description":"You discover an ancient parchment inside the college archives. It contains a jumbled sequence of numbers that seems meaningless — until you notice faint MATLAB-like symbols next to it!\r\nYour first task is to decode the clue by arranging the numbers in ascending order. The smallest number might mark the beginning of the treasure trail.\r\nGiven a row vector a, return another vector b containing all elements of a sorted in increasing order.","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; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 61.5px; transform-origin: 408px 61.5px; 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: 385px 21px; text-align: left; transform-origin: 385px 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 discover an ancient parchment inside the college archives. It contains a jumbled sequence of numbers that seems meaningless — until you notice faint MATLAB-like symbols next to it!\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: 385px 21px; text-align: left; transform-origin: 385px 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=\"\"\u003eYour first task is to \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; \"\u003edecode the clue\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 by arranging the numbers in \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; \"\u003eascending 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. The smallest number might mark the beginning of the treasure trail.\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: 385px 10.5px; text-align: left; transform-origin: 385px 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=\"\"\u003eGiven a row vector \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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ea\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, return another vector \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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eb\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 containing all elements of \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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ea\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 sorted in increasing order.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = firstClue(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = [42 7 13 5 19];\r\ny_correct = [5 7 13 19 42];\r\nassert(isequal(firstClue(a),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":4953963,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":122,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-10-21T09:21:20.000Z","updated_at":"2026-07-22T17:12:06.000Z","published_at":"2025-10-21T09:21:20.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\u003eYou discover an ancient parchment inside the college archives. It contains a jumbled sequence of numbers that seems meaningless — until you notice faint MATLAB-like symbols next to it!\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\u003eYour first task is to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edecode the clue\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e by arranging the numbers in \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eascending order\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The smallest number might mark the beginning of the treasure trail.\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\u003eGiven a row vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, return another vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e containing all elements of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e sorted in increasing order.\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":1943,"title":"Signed Magnitude","description":"For a given input vector, return the value that is furthest from zero. \r\n\r\nFor example, if \r\n\r\nx = [1 2 -12] \r\n\r\nreturn -12.","description_html":"\u003cp\u003eFor a given input vector, return the value that is furthest from zero.\u003c/p\u003e\u003cp\u003eFor example, if\u003c/p\u003e\u003cp\u003ex = [1 2 -12]\u003c/p\u003e\u003cp\u003ereturn -12.\u003c/p\u003e","function_template":"function y = signed_mag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 -12];\r\ny_correct = -12;\r\nassert(isequal(signed_mag(x),y_correct))\r\n\r\n\r\n%%\r\nx = [1 10 20];\r\ny_correct = 20;\r\nassert(isequal(signed_mag(x),y_correct))\r\n\r\n\r\n%%\r\nx = [0 0.1 -0.2];\r\ny_correct = -0.2;\r\nassert(isequal(signed_mag(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":17734,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":135,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-10-18T16:05:08.000Z","updated_at":"2026-02-17T14:57:13.000Z","published_at":"2013-10-18T16:05:08.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\u003eFor a given input vector, return the value that is furthest from zero.\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\u003eFor example, if\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\u003ex = [1 2 -12]\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\u003ereturn -12.\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":44659,"title":"Nth root of a number","description":"Given an input and a number N, find the Nth root of the number(s)","description_html":"\u003cp\u003eGiven an input and a number N, find the Nth root of the number(s)\u003c/p\u003e","function_template":"function y = rootN(a,N)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\nN = 100\r\ny_correct = 1;\r\nassert(isequal(rootN(a,N),y_correct))\r\n\r\n%%\r\na = [1 64 216];\r\nN = 3\r\ny_correct = [1    4    6];\r\nassert(isequal(rootN(a,N),y_correct))\r\n\r\n%%\r\na = 1/100;\r\nN = 2\r\ny_correct = 1/10;\r\nassert(isequal(rootN(a,N),y_correct))\r\n\r\n%%\r\na = 826^10;\r\nN = 10\r\ny_correct = 826;\r\nassert(isequal(rootN(a,N),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":61,"test_suite_updated_at":"2018-05-29T13:54:08.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T13:48:03.000Z","updated_at":"2026-05-30T00:36:23.000Z","published_at":"2018-05-29T13:48:03.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\u003eGiven an input and a number N, find the Nth root of the number(s)\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":43190,"title":"Determine point is located in a circle or not","description":"Using input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\r\nif point is located in circle, output is true.","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; 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: 269px 8px; transform-origin: 269px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsing input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\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: 126.5px 8px; transform-origin: 126.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eif point is located in circle, output is true.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = inorout(x,y)\r\n  z=true\r\nend","test_suite":"%%\r\nx = 1;\r\ny = 2;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny = 0;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 0.5;\r\ny = 0.5;\r\ny_correct = 1;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = -1;\r\ny = -1;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 0;\r\ny = 0;\r\ny_correct = 1;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny = 3;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":223089,"edited_at":"2022-09-09T07:58:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2022-09-09T07:58:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T06:42:36.000Z","updated_at":"2026-02-18T10:12:49.000Z","published_at":"2016-10-08T06:42:36.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\u003eUsing input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\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\u003eif point is located in circle, output is true.\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":1264,"title":"Center of mass","description":"Given a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid). M contains coordinates of the vertices C=[x,y,z].\r\n\r\nFind C, the center of mass of the element.","description_html":"\u003cp\u003eGiven a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid). M contains coordinates of the vertices C=[x,y,z].\u003c/p\u003e\u003cp\u003eFind C, the center of mass of the element.\u003c/p\u003e","function_template":"function C = centroid(M)\r\n\r\nend","test_suite":"%%\r\nx = [0,0,0 ; 0,0,1 ; 0,1,0 ; 0,1,1 ; 1,0,0 ; 1,0,1 ; 1,1,0 ; 1,1,1];\r\ny_correct = [0.5,0.5,0.5];\r\nassert(isequal(centroid(x),y_correct))\r\n\r\n%%\r\nx = [0,0 ; 0.5,3 ; 1,0];\r\ny_correct = [0.5,1];\r\nassert(isequal(centroid(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":3919,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":190,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-12T09:26:23.000Z","updated_at":"2026-07-24T14:10:22.000Z","published_at":"2013-02-12T09:26:33.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\u003eGiven a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid). M contains coordinates of the vertices C=[x,y,z].\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\u003eFind C, the center of mass of the element.\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":1230,"title":"Who is the smartest MATLAB programmer?","description":"Who is the smartest MATLAB programmer?\r\n\r\nExamples:\r\n\r\n  Input x = 'Is it Obama?'\r\n  Output = 'Me!'\r\n\r\n  Input x = 'Who ?'\r\n  Output = 'Me!'\r\n\r\nReturn 'Me!' to all inputs. (Note: this is only a joke!)","description_html":"\u003cp\u003eWho is the smartest MATLAB programmer?\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput x = 'Is it Obama?'\r\nOutput = 'Me!'\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eInput x = 'Who ?'\r\nOutput = 'Me!'\r\n\u003c/pre\u003e\u003cp\u003eReturn 'Me!' to all inputs. (Note: this is only a joke!)\u003c/p\u003e","function_template":"function y = smartest(x)\r\n  y = 'Not me!';\r\nend","test_suite":"%%\r\nx = 'I have been using MATLAB for 50 years!';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = 'I developed MATLAB!';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = '';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":3,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":793,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-30T01:41:14.000Z","updated_at":"2026-06-19T12:49:54.000Z","published_at":"2013-01-30T01:41: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\u003eWho is the smartest MATLAB programmer?\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\u003eExamples:\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 x = 'Is it Obama?'\\nOutput = 'Me!'\\n\\nInput x = 'Who ?'\\nOutput = 'Me!']]\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\u003eReturn 'Me!' to all inputs. (Note: this is only a joke!)\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":43740,"title":"Create a New_Word","description":"The output of the function is a new word created from the word entered into the function. The new word is created by deleting the first letter, taking the last 2 letters and moving them to the front, and adding y to the end. ","description_html":"\u003cp\u003eThe output of the function is a new word created from the word entered into the function. The new word is created by deleting the first letter, taking the last 2 letters and moving them to the front, and adding y to the end.\u003c/p\u003e","function_template":"function y = New_Word(Old_Word)\r\n  y = Old_Word;\r\nend","test_suite":"%%\r\nOld_Word = 'Welcome';\r\ny_correct = 'meelcoy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Pertinacious';\r\ny_correct = 'usertinacioy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Homogenous';\r\ny_correct = 'usomogenoy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Homologous';\r\ny_correct = 'usomologoy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Extemperaneous';\r\ny_correct = 'usxtemperaneoy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Deterministic';\r\ny_correct = 'iceterministy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":100857,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":54,"test_suite_updated_at":"2016-12-22T18:10:34.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-07T16:56:19.000Z","updated_at":"2026-05-29T02:43:19.000Z","published_at":"2016-12-07T16:56: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\",\"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\u003eThe output of the function is a new word created from the word entered into the function. The new word is created by deleting the first letter, taking the last 2 letters and moving them to the front, and adding y to the end.\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\"}]}"}],"problem_search":{"problems":[{"id":61431,"title":"Compute Radar Duty Cycle","description":"A pulsed radar transmitter operates for a limited amount of time during each transmission cycle. The duty cycle represents the fraction of time that the transmitter is active compared to the total transmission cycle duration.\r\nCreate a MATLAB function that calculates the duty cycle (DC) of a radar system. The duty cycle must be expressed as a percentage.\r\nThe function must receive three input parameters:\r\nPW: the pulse width, which represents the duration of the transmitted radar pulse; \r\nparameter: a numerical parameter that can represent either the Pulse Repetition Time (PRT) or the Pulse Repetition Frequency (PRF); \r\nparameter_type: a parameter type that specifies whether the numerical parameter represents PRT ('PRT') or PRF ('PRF')\r\nPulse Width (PW) is the duration of the transmitted pulse. It is measured in seconds (s).\r\nPulse Repetition Time (PRT) is the time interval between the beginning of two consecutive transmitted pulses. It represents the duration of one complete transmission cycle. PRT is measured in seconds (s).\r\nPulse Repetition Frequency (PRF) is the number of transmitted pulses per second. PRF is measured in Hertz (Hz).\r\nPRT and PRF are inversely related parameters. A shorter PRT corresponds to a higher PRF, while a longer PRT corresponds to a lower PRF.\r\nThe duty cycle (DC) is usually expressed as a percentage and indicates the percentage of time that the radar transmitter is active during a transmission cycle. The output value must be between 0 and 100, where 100% represents continuous wave (CW) transmission. \r\nThe output duty cycle must be rounded to two decimal places.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 406.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 203.15px; transform-origin: 468.5px 203.15px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 439.125px 8px; transform-origin: 439.125px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA pulsed radar transmitter operates for a limited amount of time during each transmission cycle. The duty cycle represents the fraction of time that the transmitter is active compared to the total transmission cycle duration.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 410.975px 8px; transform-origin: 410.975px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCreate a MATLAB function that calculates the duty cycle (DC) of a radar system. The duty cycle must be expressed as a percentage.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 154.417px 8px; transform-origin: 154.417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe function must receive three input parameters:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 61.3px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 451.5px 30.65px; transform-origin: 451.5px 30.65px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 254.25px 8px; transform-origin: 254.25px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePW: the pulse width, which represents the duration of the transmitted radar pulse; \u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 418.133px 8px; transform-origin: 418.133px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eparameter: a numerical parameter that can represent either the Pulse Repetition Time (PRT) or the Pulse Repetition Frequency (PRF); \u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 374.567px 8px; transform-origin: 374.567px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eparameter_type: a parameter type that specifies whether the numerical parameter represents PRT ('PRT') or PRF ('PRF')\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 57.8583px 8px; transform-origin: 57.8583px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ePulse Width (PW)\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: 215.858px 8px; transform-origin: 215.858px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the duration of the transmitted pulse. It is measured in seconds (s).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 93.5833px 8px; transform-origin: 93.5833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ePulse Repetition Time (PRT)\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: 340.342px 8px; transform-origin: 340.342px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the time interval between the beginning of two consecutive transmitted pulses. It represents the duration of one complete transmission cycle. PRT is measured in seconds (s).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 112.767px 8px; transform-origin: 112.767px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ePulse Repetition Frequency (PRF)\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: 248.533px 8px; transform-origin: 248.533px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is the number of transmitted pulses per second. PRF is measured in Hertz (Hz).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 437.183px 8px; transform-origin: 437.183px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ePRT and PRF are inversely related parameters. A shorter PRT corresponds to a higher PRF, while a longer PRT corresponds to a lower PRF.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 14px 8px; transform-origin: 14px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe \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: 50.95px 8px; transform-origin: 50.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eduty cycle (DC)\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: 366.8px 8px; transform-origin: 366.8px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is usually expressed as a percentage and indicates the percentage of time that the radar transmitter is active during a transmission cycle. The output value must be between 0 and 100, where 100% represents continuous wave (CW) transmission. \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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 191.758px 8px; transform-origin: 191.758px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe output duty cycle must be rounded to two decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function DC = radarDutyCycle(PW, parameter, parameter_type)\r\n  \r\nend","test_suite":"%%\r\nfiletext = fileread('radarDutyCycle.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1: Duty cycle using PRT\r\nPW = 1e-6;         \r\nPRT = 1e-3;        \r\nDC = radarDutyCycle(PW, PRT, 'PRT');\r\nassert(DC == 0.10)\r\n%% Test 2: Duty cycle using PRF\r\nPW = 1e-6;    \r\nPRF = 1000;       \r\nDC = radarDutyCycle(PW, PRF, 'PRF');\r\nassert(DC == 0.10)\r\n%% Test 3: Check equivalence between PRT and PRF\r\nPW = 5e-6;      \r\nPRT = 2e-3;      \r\nPRF = 1/PRT;\r\nDC_PRT = radarDutyCycle(PW, PRT, 'PRT');\r\nDC_PRF = radarDutyCycle(PW, PRF, 'PRF');\r\nassert(DC_PRT == DC_PRF)\r\n%% Test 4: Medium duty cycle radar\r\nPW = 50e-6; \r\nPRF = 5000;    \r\nDC = radarDutyCycle(PW, PRF, 'PRF');\r\nassert(DC == 25)\r\n%% Test 5: Continuous wave (CW) condition\r\nPW = 1e-3;       \r\nPRT = 1e-3;\r\nDC = radarDutyCycle(PW, PRT, 'PRT');\r\nassert(DC == 100)\r\n%% Test 6: Output rounding\r\nPW = 1.2345e-6;\r\nPRF = 1234;\r\nDC = radarDutyCycle(PW, PRF, 'PRF');\r\nassert(DC == 0.15)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T15:39:19.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T15:37:12.000Z","updated_at":"2026-07-29T20:35:00.000Z","published_at":"2026-07-29T15:37:12.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\u003eA pulsed radar transmitter operates for a limited amount of time during each transmission cycle. The duty cycle represents the fraction of time that the transmitter is active compared to the total transmission cycle duration.\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\u003eCreate a MATLAB function that calculates the duty cycle (DC) of a radar system. The duty cycle must be expressed as a percentage.\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\u003eThe function must receive three input parameters:\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\u003ePW: the pulse width, which represents the duration of the transmitted radar pulse; \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\u003eparameter: a numerical parameter that can represent either the Pulse Repetition Time (PRT) or the Pulse Repetition Frequency (PRF); \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\u003eparameter_type: a parameter type that specifies whether the numerical parameter represents PRT ('PRT') or PRF ('PRF')\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePulse Width (PW)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the duration of the transmitted pulse. It is measured in seconds (s).\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePulse Repetition Time (PRT)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the time interval between the beginning of two consecutive transmitted pulses. It represents the duration of one complete transmission cycle. PRT is measured in seconds (s).\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePulse Repetition Frequency (PRF)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is the number of transmitted pulses per second. PRF is measured in Hertz (Hz).\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\u003ePRT and PRF are inversely related parameters. A shorter PRT corresponds to a higher PRF, while a longer PRT corresponds to a lower PRF.\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\u003eThe \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eduty cycle (DC)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is usually expressed as a percentage and indicates the percentage of time that the radar transmitter is active during a transmission cycle. The output value must be between 0 and 100, where 100% represents continuous wave (CW) transmission. \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\u003eThe output duty cycle must be rounded to two decimal places.\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":61433,"title":"Compute Average Power of a Pulsed Radar","description":"Compute the average transmitted power of a pulsed radar over one pulse repetition time. The inputs are the peak power Pp (Watt [W]), the pulse width PW (seconds [s]), and the pulse repetition time PRT (seconds [s])  which is the time interval between the start of two consecutive radar pulses. . \r\nThe function returns the average power Pavg in watts ([W]), rounded to two decimal places.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 94.35px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 47.175px; transform-origin: 468.5px 47.175px; \"\u003e\u003cdiv style=\"block-size: 63.9px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 31.95px; text-align: left; transform-origin: 444.5px 31.95px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 373.425px 7.79167px; transform-origin: 373.425px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCompute the average transmitted power of a pulsed radar over one pulse repetition time. The inputs are the peak power \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePp\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: 48.7167px 7.79167px; transform-origin: 48.7167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (Watt [W]), the pulse width \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePW\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: 135.742px 7.79167px; transform-origin: 135.742px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (seconds [s]), and the pulse repetition time \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: 11.55px 7.79167px; transform-origin: 11.55px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 11.55px 8.25px; transform-origin: 11.55px 8.25px; \"\u003ePRT\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: 239.192px 7.79167px; transform-origin: 239.192px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (seconds [s])  which is the time interval between the start of two consecutive radar pulses. . \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.45px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.725px; text-align: left; transform-origin: 444.5px 10.725px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 124.083px 7.79167px; transform-origin: 124.083px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe function returns the average power \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: 15.4px 7.79167px; transform-origin: 15.4px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 15.4px 8.25px; transform-origin: 15.4px 8.25px; \"\u003ePavg\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: 143.125px 7.79167px; transform-origin: 143.125px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in watts ([W]), rounded to two decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Pavg = averageRadarPower(PRT,Pp,PW)\r\n   \r\nend","test_suite":"%%\r\nfiletext = fileread('averageRadarPower.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%%\r\nassert(isequal(averageRadarPower(1e-3,1000,1e-6),1.00))\r\n%%\r\nassert(isequal(averageRadarPower(2e-3,5000,5e-6),12.50))\r\n%%\r\nassert(isequal(averageRadarPower(1e-2,2e6,2e-6),400.00))\r\n%%\r\nassert(isequal(averageRadarPower(1e-3,1000,1e-6),1.00))\r\n%%\r\nassert(isequal(averageRadarPower(2e-3,5000,5e-6),12.50))\r\n%%\r\nassert(isequal(averageRadarPower(1e-2,2e6,2e-6),400.00))\r\n%%\r\nassert(isequal(averageRadarPower(5e-3,8000,4e-6),6.40))\r\n%%\r\nassert(isequal(averageRadarPower(1e-3,2500,2e-6),5.00))\r\n%%\r\nassert(isequal(averageRadarPower(8e-3,1e5,1e-5),125.00))\r\n%%\r\nassert(isequal(averageRadarPower(4e-3,7500,8e-6),15.00))\r\n%%\r\nassert(isequal(averageRadarPower(2e-2,3e6,1e-6),150.00))\r\n%%\r\nassert(isequal(averageRadarPower(3e-3,12345,7e-6),28.81))\r\n%%\r\nassert(isequal(averageRadarPower(7e-3,9876,3e-6),4.23))\r\n%%\r\nassert(isequal(averageRadarPower(1.5e-3,4567,8e-6),24.36))\r\n%%\r\nassert(isequal(averageRadarPower(2.5e-3,13579,4e-6),21.73))\r\n%%\r\nassert(isequal(averageRadarPower(6e-3,22222,9e-6),33.33))\r\n%%\r\nassert(isequal(averageRadarPower(1,1,1/3),0.33))\r\n%%\r\nassert(isequal(averageRadarPower(1,10,1/6),1.67))\r\n%%\r\nassert(isequal(averageRadarPower(1,5,2/9),1.11))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-30T07:15:27.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":"2026-07-30T07:09:39.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T07:09:22.000Z","updated_at":"2026-07-30T09:12:58.000Z","published_at":"2026-07-30T07:09:22.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\u003eCompute the average transmitted power of a pulsed radar over one pulse repetition time. The inputs are the peak power \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (Watt [W]), the pulse width \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePW\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (seconds [s]), and the pulse repetition time \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePRT\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (seconds [s])  which is the time interval between the start of two consecutive radar pulses. . \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\u003eThe function returns the average power \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePavg\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in watts ([W]), rounded to two decimal places.\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":61435,"title":"Radar Unambiguous Range Determination","description":"This problem aims to determine the radar unambiguous range based on the Pulse Repetition Frequency (PRF). The function takes the PRF value as input, expressed in Hertz (Hz), and calculates the maximum range at which a target can be detected without ambiguity.\r\nThe speed of light is used as a constant parameter, with a value of c = 299792458 meters per second (m/s). The output of the function is the unambiguous range, expressed in meters (m), rounded to two decimal places..\r\nThe calculation assumes that the pulse duration is negligible compared to the Pulse Repetition Time (PRT), since the pulse width is typically much smaller than the time interval between consecutive transmitted pulses. Therefore, the effect of pulse duration is neglected.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 72px; transform-origin: 468.5px 72px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 433.317px 7.79167px; transform-origin: 433.317px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis problem aims to determine the radar unambiguous range based on the Pulse Repetition Frequency (PRF). The function takes the PRF value as input, expressed in Hertz (Hz), and calculates the maximum range at which a target can be detected without ambiguity.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 435.425px 7.79167px; transform-origin: 435.425px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe speed of light is used as a constant parameter, with a value of c = 299792458 meters per second (m/s). The output of the function is the unambiguous range, expressed in meters (m), rounded to two decimal places..\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 434.5px 7.79167px; transform-origin: 434.5px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe calculation assumes that the pulse duration is negligible compared to the Pulse Repetition Time (PRT), since the pulse width is typically much smaller than the time interval between consecutive transmitted pulses. Therefore, the effect of pulse duration is neglected.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function unambiguous_range = calculate_unambiguous_range(PRF)\r\n    \r\nend","test_suite":"%%\r\nfiletext = fileread('calculate_unambiguous_range.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nPRF = 1000;\r\nexpected_range = 149896.23;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)\r\n%% Test 2\r\nPRF = 5000;\r\nexpected_range = 29979.25;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)\r\n%% Test 3\r\nPRF = 200;\r\nexpected_range = 749481.15;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)\r\n% Test 4: \r\nPRF = 10000;\r\nexpected_range = 14989.62;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)\r\n% Test 5:\r\nPRF = 1500;\r\nexpected_range = 99930.82;\r\nresult = calculate_unambiguous_range(PRF);\r\nassert(result == expected_range)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T08:46:34.000Z","updated_at":"2026-07-30T08:46:49.000Z","published_at":"2026-07-30T08:46:34.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\u003eThis problem aims to determine the radar unambiguous range based on the Pulse Repetition Frequency (PRF). The function takes the PRF value as input, expressed in Hertz (Hz), and calculates the maximum range at which a target can be detected without ambiguity.\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\u003eThe speed of light is used as a constant parameter, with a value of c = 299792458 meters per second (m/s). The output of the function is the unambiguous range, expressed in meters (m), rounded to two decimal places..\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\u003eThe calculation assumes that the pulse duration is negligible compared to the Pulse Repetition Time (PRT), since the pulse width is typically much smaller than the time interval between consecutive transmitted pulses. Therefore, the effect of pulse duration is neglected.\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":61437,"title":"Calculation of Radar Dwell Time","description":"This problem aims to determine the dwell time of a 2D-search radar antenna. The function takes as input the antenna horizontal beamwidth thetaAz and the antenna rotation speed n, and calculates the time during which the radar beam illuminates a target during one scan.\r\nThe horizontal beamwidth is expressed in degrees (°), while the antenna rotation speed is expressed in revolutions per minute (RPM). The output of the function is the dwell time Td, expressed in seconds (s).\r\nThe calculation assumes a constant antenna rotation speed and a uniform azimuthal scan, neglecting acceleration and deceleration effects during antenna movement.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 72px; transform-origin: 468.5px 72px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 432.55px 7.79167px; transform-origin: 432.55px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis problem aims to determine the dwell time of a 2D-search radar antenna. The function takes as input the antenna horizontal beamwidth thetaAz and the antenna rotation speed n, and calculates the time during which the radar beam illuminates a target during one scan.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 429.917px 7.79167px; transform-origin: 429.917px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe horizontal beamwidth is expressed in degrees (°), while the antenna rotation speed is expressed in revolutions per minute (RPM). The output of the function is the dwell time Td, expressed in seconds (s).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 431.667px 7.79167px; transform-origin: 431.667px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe calculation assumes a constant antenna rotation speed and a uniform azimuthal scan, neglecting acceleration and deceleration effects during antenna movement.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Td = calculate_dwell_time(thetaAz, n)\r\n \r\nend","test_suite":"%%\r\nfiletext = fileread('calculate_dwell_time.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'conv')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nthetaAz = 2;     \r\nn = 12;           \r\nexpected_Td = 0.0278;  \r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n%% Test 2\r\nthetaAz = 1;      \r\nn = 12;           \r\nexpected_Td = 0.0139;\r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n%% Test 3\r\nthetaAz = 2;\r\nn = 6;\r\nexpected_Td = 0.0556;\r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n%% Test 4\r\nthetaAz = 5;\r\nn = 12;\r\nexpected_Td = 0.0694;\r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n%% Test 5\r\nthetaAz = 2;\r\nn = 30;\r\nexpected_Td = 0.0111;\r\nresult = calculate_dwell_time(thetaAz, n);\r\nassert(abs(result - expected_Td) \u003c 1e-4)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T09:19:50.000Z","updated_at":"2026-07-30T09:20:21.000Z","published_at":"2026-07-30T09:19:50.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\u003eThis problem aims to determine the dwell time of a 2D-search radar antenna. The function takes as input the antenna horizontal beamwidth thetaAz and the antenna rotation speed n, and calculates the time during which the radar beam illuminates a target during one scan.\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\u003eThe horizontal beamwidth is expressed in degrees (°), while the antenna rotation speed is expressed in revolutions per minute (RPM). The output of the function is the dwell time Td, expressed in seconds (s).\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\u003eThe calculation assumes a constant antenna rotation speed and a uniform azimuthal scan, neglecting acceleration and deceleration effects during antenna movement.\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":61432,"title":"Compute Radar Wavelength from Frequency","description":"Radar systems operate at electromagnetic frequencies. The wavelength of the transmitted signal is related to the operating frequency through the propagation speed of electromagnetic waves.\r\nThe speed of electromagnetic waves in free space must be considered equal to 299792458 m/s.\r\nCreate a MATLAB function that calculates the radar wavelength (in meters [m]) from the operating frequency (in Hertz [Hz]).\r\nThe function must receive the radar operating frequency as input and return the corresponding wavelength.\r\nThe output wavelength must be rounded to five decimal places.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 162px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 81px; transform-origin: 468.5px 81px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 440.325px 8px; transform-origin: 440.325px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRadar systems operate at electromagnetic frequencies. The wavelength of the transmitted signal is related to the operating frequency through the propagation speed of electromagnetic waves.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 297.967px 8px; transform-origin: 297.967px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe speed of electromagnetic waves in free space must be considered equal to 299792458 m/s.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 382.2px 8px; transform-origin: 382.2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCreate a MATLAB function that calculates the radar wavelength (in meters [m]) from the operating frequency (in Hertz [Hz]).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 331.425px 8px; transform-origin: 331.425px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe function must receive the radar operating frequency as input and return the corresponding wavelength.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 196.05px 8px; transform-origin: 196.05px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe output wavelength must be rounded to five decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function lambda = radarWavelength(f)\r\n% Write your code here\r\nend","test_suite":"%%\r\nfiletext = fileread('radarWavelength.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nf = 10e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.02998)\r\n%% Test 2\r\nf = 3e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.09993)\r\n%% Test 3\r\nf = 5.6e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.05353)\r\n%% Test 4\r\nf = 77e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.00389)\r\n%% Test 5\r\nf1 = 5e9;\r\nf2 = 10e9;\r\nlambda1 = radarWavelength(f1);\r\nlambda2 = radarWavelength(f2);\r\nassert(lambda1 == 2*lambda2)\r\n%% Test 6\r\nf = 1e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.29979)\r\n%% Test 7\r\nf = 35e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.00857)\r\n%% Test 8\r\nf = 120e9;\r\nlambda = radarWavelength(f);\r\nassert(lambda == 0.00250)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T15:54:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":"2026-07-29T15:54:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T15:51:56.000Z","updated_at":"2026-07-29T20:36:08.000Z","published_at":"2026-07-29T15:51:56.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\u003eRadar systems operate at electromagnetic frequencies. The wavelength of the transmitted signal is related to the operating frequency through the propagation speed of electromagnetic waves.\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\u003eThe speed of electromagnetic waves in free space must be considered equal to 299792458 m/s.\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\u003eCreate a MATLAB function that calculates the radar wavelength (in meters [m]) from the operating frequency (in Hertz [Hz]).\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\u003eThe function must receive the radar operating frequency as input and return the corresponding wavelength.\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\u003eThe output wavelength must be rounded to five decimal places.\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":61434,"title":"Calculate Radar Pulse Energy","description":"Compute the energy contained in a single radar pulse. The inputs are the peak power Pp (W) and the pulse width PW (s). The pulse repetition time PRT (s), defined as the time interval between the beginning of two consecutive pulses, is not required for this calculation but is related to the radar pulse sequence and average power. The output is the pulse energy Ep in joules (J) rounded to three decimal places., obtained from the transmitted power during the pulse duration.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 85.35px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 42.675px; transform-origin: 468.5px 42.675px; \"\u003e\u003cdiv style=\"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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 42.675px; text-align: left; transform-origin: 444.5px 42.675px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 266.467px 7.79167px; transform-origin: 266.467px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCompute the energy contained in a single radar pulse. The inputs are the peak power \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePp\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: 77.4px 7.79167px; transform-origin: 77.4px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (W) and the pulse width \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003ePW\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: 77.4px 7.79167px; transform-origin: 77.4px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (s). The pulse repetition time \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: 11.55px 7.79167px; transform-origin: 11.55px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 11.55px 8.25px; transform-origin: 11.55px 8.25px; \"\u003ePRT\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: 409.592px 7.79167px; transform-origin: 409.592px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (s), defined as the time interval between the beginning of two consecutive pulses, is not required for this calculation but is related to the radar pulse sequence and average power. The output is the pulse energy \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: 7.7px 7.79167px; transform-origin: 7.7px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 7.7px 8.25px; transform-origin: 7.7px 8.25px; \"\u003eEp\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: 189.825px 7.79167px; transform-origin: 189.825px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e in joules (J) rounded to three decimal places., obtained from the transmitted power during the pulse duration.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Ep = radarPulseEnergy(Pp,PW)\r\n \r\nend","test_suite":"%%\r\nfiletext = fileread('radarPulseEnergy.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%%\r\nassert(isequal(radarPulseEnergy(50e3,2.5e-6),0.125))\r\n%%\r\nassert(isequal(radarPulseEnergy(250e3,5e-6),1.250))\r\n%%\r\nassert(isequal(radarPulseEnergy(1e6,3e-6),3.000))\r\n%%\r\nassert(isequal(radarPulseEnergy(2.5e6,4.5e-6),11.250))\r\n%%\r\nassert(isequal(radarPulseEnergy(5e6,8e-6),40.000))\r\n%%\r\nassert(isequal(radarPulseEnergy(10e6,10e-6),100.000))\r\n%%\r\nassert(isequal(radarPulseEnergy(750e3,3.75e-6),2.813))\r\n%%\r\nassert(isequal(radarPulseEnergy(1.8e6,6.25e-6),11.250))\r\n%%\r\nassert(isequal(radarPulseEnergy(3.2e6,7.85e-6),25.120))\r\n%%\r\nassert(isequal(radarPulseEnergy(7.5e6,4.33e-6),32.475))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T07:27:50.000Z","updated_at":"2026-07-30T07:53:11.000Z","published_at":"2026-07-30T07:27:50.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\u003eCompute the energy contained in a single radar pulse. The inputs are the peak power \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (W) and the pulse width \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePW\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (s). The pulse repetition time \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePRT\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (s), defined as the time interval between the beginning of two consecutive pulses, is not required for this calculation but is related to the radar pulse sequence and average power. The output is the pulse energy \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEp\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in joules (J) rounded to three decimal places., obtained from the transmitted power during the pulse duration.\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":61436,"title":"Monostatic Radar Received Power Calculation","description":"This problem aims to determine the received power of a monostatic radar system. The function takes as input the main radar parameters, including transmitted power, antenna gain, wavelength, target radar cross section, and target range, and calculates the power of the received echo signal.\r\nThe calculation is based on the monostatic radar equation, where the same antenna is used for both transmission and reception. The input parameters are expressed using SI units: transmitted power in Watts (W), antenna gain as a dimensionless linear value, wavelength in meters (m), radar cross section in square meters (m²), and target range in meters (m).\r\nThe output of the function is the received power expressed in Watts (W). The calculation assumes ideal propagation conditions and neglects losses due to atmospheric attenuation, system losses, and noise effects.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 186px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 93px; transform-origin: 468.5px 93px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 31.5px; text-align: left; transform-origin: 444.5px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 426.683px 7.79167px; transform-origin: 426.683px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis problem aims to determine the received power of a monostatic radar system. The function takes as input the main radar parameters, including transmitted power, antenna gain, wavelength, target radar cross section, and target range, and calculates the power of the received echo signal.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 31.5px; text-align: left; transform-origin: 444.5px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 430.608px 7.79167px; transform-origin: 430.608px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe calculation is based on the monostatic radar equation, where the same antenna is used for both transmission and reception. The input parameters are expressed using SI units: transmitted power in Watts (W), antenna gain as a dimensionless linear value, wavelength in meters (m), radar cross section in square meters (m²), and target range in meters (m).\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 435.4px 7.79167px; transform-origin: 435.4px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe output of the function is the received power expressed in Watts (W). The calculation assumes ideal propagation conditions and neglects losses due to atmospheric attenuation, system losses, and noise effects.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Pr = calculate_received_power(Pt, G, lambda, sigma, R)\r\n\r\nend","test_suite":"%%\r\nfiletext = fileread('calculate_received_power.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nPt = 1000;        \r\nG = 100;          \r\nlambda = 0.03;    \r\nsigma = 10;       \r\nR = 10000;        \r\nexpected_Pr = 4.5354e-15; \r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-18)\r\n%% Test 2\r\nPt = 1000;\r\nG = 100;\r\nlambda = 0.03;\r\nsigma = 50;\r\nR = 10000;\r\nexpected_Pr = 2.2677e-14;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-18)\r\n%% Test 3\r\nPt = 1000;\r\nG = 100;\r\nlambda = 0.03;\r\nsigma = 10;\r\nR = 20000;\r\nexpected_Pr = 2.8346e-16;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-20)\r\n%% Test 4\r\nPt = 5000;\r\nG = 100;\r\nlambda = 0.03;\r\nsigma = 10;\r\nR = 10000;\r\nexpected_Pr = 2.2677e-14;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-18)\r\n%% Test 5\r\nPt = 1000;\r\nG = 100;\r\nlambda = 0.06;\r\nsigma = 10;\r\nR = 10000;\r\nexpected_Pr = 1.8142e-14;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-18)\r\n%% Test 6\r\nPt = 1000;\r\nG = 1;\r\nlambda = 0.03;\r\nsigma = 10;\r\nR = 10000;\r\nexpected_Pr = 4.5354e-19;\r\nresult = calculate_received_power(Pt, G, lambda, sigma, R);\r\nassert(abs(result - expected_Pr) \u003c 1e-22)","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-30T09:08:24.000Z","updated_at":"2026-07-30T09:08:40.000Z","published_at":"2026-07-30T09:08:23.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\u003eThis problem aims to determine the received power of a monostatic radar system. The function takes as input the main radar parameters, including transmitted power, antenna gain, wavelength, target radar cross section, and target range, and calculates the power of the received echo signal.\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\u003eThe calculation is based on the monostatic radar equation, where the same antenna is used for both transmission and reception. The input parameters are expressed using SI units: transmitted power in Watts (W), antenna gain as a dimensionless linear value, wavelength in meters (m), radar cross section in square meters (m²), and target range in meters (m).\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\u003eThe output of the function is the received power expressed in Watts (W). The calculation assumes ideal propagation conditions and neglects losses due to atmospheric attenuation, system losses, and noise effects.\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":61427,"title":"Calculate Target Doppler Frequency Shift for a Pulse-Doppler Radar","description":"Calculate the target Doppler frequency shift measured by a pulse-Doppler radar.\r\nA radar system operates at a carrier frequency of 10 GHz (X-band). The function must calculate the Doppler frequency produced by an aircraft moving relative to the radar.\r\nThe input parameters are:\r\nthe target motion direction: \"closing\" if the aircraft is approaching the radar, or \"receding\" if the aircraft is moving away from the radar;\r\nthe magnitude of the radial velocity of the aircraft in m/s (a positive value).\r\nAssume the speed of light is c = 299792458 m/s.\r\nThe output must be the Doppler frequency shift in Hz, rounded to two decimal places.\r\nA positive Doppler frequency corresponds to an approaching target, while a negative Doppler frequency corresponds to a receding target.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 253.867px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 126.933px; transform-origin: 468.5px 126.933px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 248.183px 8px; transform-origin: 248.183px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCalculate the target Doppler frequency shift measured by a pulse-Doppler radar.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 442.242px 8px; transform-origin: 442.242px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA radar system operates at a carrier frequency of 10 GHz (X-band). The function must calculate the Doppler frequency produced by an aircraft moving relative to the radar.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 80.5167px 8px; transform-origin: 80.5167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe input parameters are:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cul style=\"block-size: 40.8667px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 451.5px 20.4333px; transform-origin: 451.5px 20.4333px; margin-top: 10px; margin-bottom: 20px; \"\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 410.95px 8px; transform-origin: 410.95px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethe target motion direction: \"closing\" if the aircraft is approaching the radar, or \"receding\" if the aircraft is moving away from the radar;\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli style=\"block-size: 20.4333px; 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: 423.5px 10.2167px; text-align: left; transform-origin: 423.5px 10.2167px; white-space-collapse: preserve; margin-left: 56px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-inline-start: 0px; margin-left: 0px; perspective-origin: 228.317px 8px; transform-origin: 228.317px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethe magnitude of the radial velocity of the aircraft in m/s (a positive value).\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003c/ul\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 151.117px 8px; transform-origin: 151.117px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAssume the speed of light is c = 299792458 m/s.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 264.108px 8px; transform-origin: 264.108px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe output must be the Doppler frequency shift in Hz, rounded to two decimal places.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 425.575px 8px; transform-origin: 425.575px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA positive Doppler frequency corresponds to an approaching target, while a negative Doppler frequency corresponds to a receding target.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(target_type, vr)\r\n  y =\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\n%% Closing target\r\nyour_fcn_name(\"closing\",300)\r\nassert(isequal(your_fcn_name(\"closing\",300),20013.85))\r\n%% Receding target\r\nassert(isequal(your_fcn_name(\"receding\",300),-20013.85))\r\n%% Different velocity\r\nassert(isequal(your_fcn_name(\"closing\",100), 6671.28))\r\n%% Zero radial velocity\r\nassert(isequal(your_fcn_name(\"closing\",0), 0.00))\r\n%% High speed aircraft\r\nassert(isequal(your_fcn_name(\"closing\",1000),66712.82))\r\n%% High speed receding target\r\nassert(isequal(your_fcn_name(\"receding\",1000),-66712.82))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T10:32:44.000Z","deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":"2026-07-29T10:18:44.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T10:17:42.000Z","updated_at":"2026-07-30T14:07:01.000Z","published_at":"2026-07-29T10:17:42.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\u003eCalculate the target Doppler frequency shift measured by a pulse-Doppler radar.\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\u003eA radar system operates at a carrier frequency of 10 GHz (X-band). The function must calculate the Doppler frequency produced by an aircraft moving relative to the radar.\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\u003eThe input parameters are:\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\u003ethe target motion direction: \\\"closing\\\" if the aircraft is approaching the radar, or \\\"receding\\\" if the aircraft is moving away from the radar;\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\u003ethe magnitude of the radial velocity of the aircraft in m/s (a positive value).\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\u003eAssume the speed of light is c = 299792458 m/s.\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\u003eThe output must be the Doppler frequency shift in Hz, rounded to two decimal places.\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\u003eA positive Doppler frequency corresponds to an approaching target, while a negative Doppler frequency corresponds to a receding target.\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":61430,"title":"Radar Target Distance Calculation","description":"A radar system sends a short electromagnetic pulse toward a target and measures the elapsed time between transmission and reception of the reflected echo.\r\nWrite a function that takes this elapsed time in seconds as input and returns the estimated target distance in meters, rounded to two decimal places.\r\nAssume that the pulse travels at the speed of light (c = 299792458 m/s).","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 61.5px; transform-origin: 468.5px 61.5px; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 444.5px 8px; transform-origin: 444.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA radar system sends a short electromagnetic pulse toward a target and measures the elapsed time between transmission and reception of the reflected echo.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21px; text-align: left; transform-origin: 444.5px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 435.117px 8px; transform-origin: 435.117px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that takes this elapsed time in seconds as input and returns the estimated target distance in meters, rounded to two decimal places.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 223.067px 8px; transform-origin: 223.067px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAssume that the pulse travels at the speed of light (c = 299792458 m/s).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(t)\r\n  y = \r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%% Test 1\r\nt = 2e-6; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,299.79))\r\n\r\n%% Test 2\r\nt = 10e-6; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,1498.96))\r\n\r\n%% Test 3\r\nt = 100e-9; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,14.99))\r\n\r\n%% Test 4\r\nt = 1e-3; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,149896.23))\r\n\r\n%% Test 5\r\nt = 0; \r\nd = your_fcn_name(t);\r\nassert(isequal(d,0.00))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T13:52:44.000Z","deleted_by":null,"deleted_at":null,"solvers_count":3,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T13:51:57.000Z","updated_at":"2026-07-30T14:11:17.000Z","published_at":"2026-07-29T13:51:57.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\u003eA radar system sends a short electromagnetic pulse toward a target and measures the elapsed time between transmission and reception of the reflected echo.\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\u003eWrite a function that takes this elapsed time in seconds as input and returns the estimated target distance in meters, rounded to two decimal places.\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\u003eAssume that the pulse travels at the speed of light (c = 299792458 m/s).\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":61426,"title":"Range Resolution of a Pulsed Radar","description":"A pulsed radar transmits a rectangular pulse with duration tau seconds. Given the pulse duration, compute the radar range resolution in meters. Assume the speed of light is 299792458 m/s.\r\nRound the result to two decimal places.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"baseline-shift: 0px; block-size: 73px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 36.5px; transform-origin: 468.5px 36.5px; \"\u003e\u003cdiv style=\"block-size: 43px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 21.5px; text-align: left; transform-origin: 444.5px 21.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 180.883px 8px; transform-origin: 180.883px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA pulsed radar transmits a rectangular pulse with duration \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: 11.55px 8px; transform-origin: 11.55px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 11.55px 8.5px; transform-origin: 11.55px 8.5px; \"\u003etau\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: 229.892px 8px; transform-origin: 229.892px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e seconds. Given the pulse duration, compute the radar range resolution in meters. Assume the speed of light is \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: 53.9px 8px; transform-origin: 53.9px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; perspective-origin: 53.9px 8.5px; transform-origin: 53.9px 8.5px; \"\u003e299792458 m/s.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 122.142px 8px; transform-origin: 122.142px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eRound the result to two decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(tau)\r\n  y = \r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'regexp')))\r\nassert(isempty(strfind(filetext, 'echo')))\r\nassert(isempty(strfind(filetext, 'assignin')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\nassert(isempty(strfind(filetext, 'persistent')))\r\nassert(isempty(strfind(filetext, 'global')))\r\n%%\r\nassert(isequal(your_fcn_name(1e-6),149.90))\r\n%%\r\nassert(isequal(your_fcn_name(2e-6),299.79))\r\n%%\r\nassert(isequal(your_fcn_name(5e-7),74.95))\r\n%%\r\nassert(isequal(your_fcn_name(1e-8),1.50))\r\n%%\r\nassert(isequal(your_fcn_name(10e-6),1498.96))\r\n%%\r\nassert(isequal(your_fcn_name(10e-7),149.90))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":5046205,"edited_by":5046205,"edited_at":"2026-07-29T10:20:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-07-29T07:03:34.000Z","updated_at":"2026-07-30T16:07:38.000Z","published_at":"2026-07-29T07:03:34.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\u003eA pulsed radar transmits a rectangular pulse with duration \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etau\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e seconds. Given the pulse duration, compute the radar range resolution in meters. Assume the speed of light is \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e299792458 m/s.\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\u003eRound the result to two decimal places.\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":44634,"title":"Basic matrix operations using standard MATLAB commands","description":"Create the matrix:\r\n\r\n 1.0e+15 *\r\n\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0001    0.0010    0.0100    0.1000    1.0000\r\n\r\nFind the row vector of all column means\r\n\r\nHint: Use _logspace_ to create the matrix. Avoid looking at the test suite before writing a solution","description_html":"\u003cp\u003eCreate the matrix:\u003c/p\u003e\u003cpre\u003e 1.0e+15 *\u003c/pre\u003e\u003cpre\u003e    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0001    0.0010    0.0100    0.1000    1.0000\u003c/pre\u003e\u003cp\u003eFind the row vector of all column means\u003c/p\u003e\u003cp\u003eHint: Use \u003ci\u003elogspace\u003c/i\u003e to create the matrix. Avoid looking at the test suite before writing a solution\u003c/p\u003e","function_template":"function y = matrix_ls_means()\r\n  y = x;\r\nend","test_suite":"%%\r\ny_correct = mean([logspace(1,5,5);logspace(6,10,5);logspace(11,15,5)]);\r\nassert(isequal(matrix_ls_means(),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2018-05-09T05:37:01.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-09T05:32:41.000Z","updated_at":"2026-07-24T09:39:25.000Z","published_at":"2018-05-09T05:35:49.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\u003eCreate the matrix:\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.0e+15 *\\n\\n    0.0000    0.0000    0.0000    0.0000    0.0000\\n    0.0000    0.0000    0.0000    0.0000    0.0000\\n    0.0001    0.0010    0.0100    0.1000    1.0000]]\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\u003eFind the row vector of all column means\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\u003eHint: Use\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\u003elogspace\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to create the matrix. Avoid looking at the test suite before writing a solution\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":44546,"title":"Calculating the total earnings of a factory","description":"The row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.","description_html":"\u003cp\u003eThe row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.\u003c/p\u003e","function_template":"function earn = earnings(rate, price)\r\n    earn= (); % use your basic knowledge of matrix multiplication\r\nend","test_suite":"%%\r\nrate = [2,5,4];\r\nprice = [8,3,1];\r\ny_correct = 3360;\r\nassert(isequal(earnings(rate,price),3360))\r\n%%\r\nrate = [1,4];\r\nprice = [2,1];\r\ny_correct = 576;\r\nassert(isequal(earnings(rate,price),576))\r\n%%\r\nrate = [6 6 2 3 2 8];\r\nprice = [3 2 4 8 9 5];\r\ny_correct = 11520;\r\nassert(isequal(earnings(rate,price),11520))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-03-31T09:16:35.000Z","updated_at":"2026-05-29T04:26:47.000Z","published_at":"2018-03-31T09:16: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\",\"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\u003eThe row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.\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":52133,"title":"MATLAB Basics: Complex Conjugates","description":"For a given complex number, x, return the complex conjugate, y.","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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: 200.5px 8px; transform-origin: 200.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor a given complex number, x, return the complex conjugate, y.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = compconj(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1+i;\r\ny_correct = 1-i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 1-i;\r\ny_correct = 1+i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 3i;\r\ny_correct = -3i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 7;\r\ny_correct = 7;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 7-13i;\r\ny_correct = 7+13i;\r\nassert(isequal(compconj(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":1231855,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":63,"test_suite_updated_at":"2021-06-28T19:38:20.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-28T14:07:04.000Z","updated_at":"2026-07-19T16:30:14.000Z","published_at":"2021-06-28T14:07:36.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\u003eFor a given complex number, x, return the complex conjugate, y.\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":44670,"title":"Basic Quadratic Equation","description":"Create the equation:\r\n\r\ny=(3x)^2+(5x)+35\r\nand compute y for various values of x","description_html":"\u003cp\u003eCreate the equation:\u003c/p\u003e\u003cp\u003ey=(3x)^2+(5x)+35\r\nand compute y for various values of x\u003c/p\u003e","function_template":"function y = quad1(x)\r\n\r\nend","test_suite":"%%\r\nx = -3;\r\ny_correct = 101;\r\nassert(isequal(quad1(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 285;\r\nassert(isequal(quad1(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":93,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-30T10:55:15.000Z","updated_at":"2026-07-24T14:07:04.000Z","published_at":"2018-05-30T10:55:15.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\u003eCreate the equation:\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=(3x)^2+(5x)+35 and compute y for various values of x\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":46763,"title":"Double the length of the vector","description":null,"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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ex=[1 2 3 4]\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ey=[1 0 2 0 3 0 4 0]\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAdd zeros in between the data\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function double= your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [5 4 3 2];\r\ny_correct = [5 0 4 0 3 0 2 0];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx= [1 2 3 4];\r\ny_correct=[1 0 2 0 3 0 4 0];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":628208,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-16T15:49:54.000Z","updated_at":"2026-05-30T17:05:29.000Z","published_at":"2020-10-16T15:57:17.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\u003ex=[1 2 3 4]\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=[1 0 2 0 3 0 4 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdd zeros in between the data\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":58254,"title":"Find the mean of the magic x","description":"Given a x term, find the magic x, then find the mean/average of any one row or column.","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.5px 10.5px; transform-origin: 406.5px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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: 383.494px 10.5px; text-align: left; transform-origin: 383.503px 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven a x term, find the magic x, then find the mean/average of any one row or column.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = mean_magic(x)\r\ny = x;\r\n","test_suite":"%%\r\nx = 5;\r\ny_correct = 13;\r\nassert(isequal(mean_magic(x),y_correct))\r\n%%\r\nx = 15;\r\ny_correct = 113;\r\nassert(isequal(mean_magic(x),y_correct))\r\n%%\r\nx = 12;\r\ny_correct = 72.5;\r\nassert(isequal(mean_magic(x),y_correct))\r\n%%\r\nx = 22;\r\ny_correct = 242.5;\r\nassert(isequal(mean_magic(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3227359,"edited_by":3227359,"edited_at":"2023-05-03T16:41:31.000Z","deleted_by":null,"deleted_at":null,"solvers_count":24,"test_suite_updated_at":"2023-05-03T16:41:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2023-05-03T14:54:47.000Z","updated_at":"2026-06-04T00:28:19.000Z","published_at":"2023-05-03T14:54:47.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\u003eGiven a x term, find the magic x, then find the mean/average of any one row or column.\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":43566,"title":"Create vector as shown in test cases","description":"Create vector as shown in test cases","description_html":"\u003cp\u003eCreate vector as shown in test cases\u003c/p\u003e","function_template":"function y = vec_rev(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 100;\r\ny_correct = 100:-1:0;\r\nassert(isequal(vec_rev(x),y_correct))\r\n\r\n%%\r\nx = 45;\r\ny_correct = 45:-1:0;\r\nassert(isequal(vec_rev(x),y_correct))\r\n\r\n%%\r\nx = 20;\r\ny_correct = 20:-1:0;\r\nassert(isequal(vec_rev(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":254,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-16T14:53:00.000Z","updated_at":"2026-04-13T13:50:37.000Z","published_at":"2016-10-16T14:53: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\",\"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\u003eCreate vector as shown in test cases\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":43333,"title":"Save variables","description":"a=[1]\r\n\r\nSave variable a that is located in workspace into current folder. File name should be 'a.mat'","description_html":"\u003cp\u003ea=[1]\u003c/p\u003e\u003cp\u003eSave variable a that is located in workspace into current folder. File name should be 'a.mat'\u003c/p\u003e","function_template":"function y = savevar(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\nsavevar(a)\r\nii=ls('a.mat')\r\nassert(~isempty(ii))\r\n\r\n%%\r\nclear\r\nload a\r\nassert(a==1)","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2016-10-15T04:35:08.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-11T14:13:40.000Z","updated_at":"2026-02-06T12:20:54.000Z","published_at":"2016-10-11T14:13: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\u003ea=[1]\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\u003eSave variable a that is located in workspace into current folder. File name should be 'a.mat'\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":43156,"title":"Find x in provided equation!","description":"x^2-2*x+1=0\r\n\r\nThis polynomial can be expressed by using each term's coefficients, such as\r\n\r\n[1 -2 1].\r\n\r\nUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \"roots\")","description_html":"\u003cp\u003ex^2-2*x+1=0\u003c/p\u003e\u003cp\u003eThis polynomial can be expressed by using each term's coefficients, such as\u003c/p\u003e\u003cp\u003e[1 -2 1].\u003c/p\u003e\u003cp\u003eUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \"roots\")\u003c/p\u003e","function_template":"function y = solvepol(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 -2 1];\r\ny_correct = [1;1];\r\nassert(isequal(solvepol(x),y_correct))\r\n\r\n%%\r\nx = [1 -3 2];\r\ny_correct = [2;1];\r\nassert(isequal(solvepol(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":121,"test_suite_updated_at":"2016-10-21T06:37:13.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T13:48:30.000Z","updated_at":"2026-04-08T13:10:52.000Z","published_at":"2016-10-07T13:48:51.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\u003ex^2-2*x+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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis polynomial can be expressed by using each term's coefficients, such as\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[1 -2 1].\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\u003eUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \\\"roots\\\")\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":2875,"title":"Find difference of two set as per example","description":"Find difference of two set as per example\r\n\r\nSay x=[1:5] and y=[2:6]\r\n\r\nthen, set_diff(x,y) should give output[1] and set_diff(y,x) should give output[6]","description_html":"\u003cp\u003eFind difference of two set as per example\u003c/p\u003e\u003cp\u003eSay x=[1:5] and y=[2:6]\u003c/p\u003e\u003cp\u003ethen, set_diff(x,y) should give output[1] and set_diff(y,x) should give output[6]\u003c/p\u003e","function_template":"function jj = set_diff(x,y)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1:5;\r\ny = 2:6;\r\ny_correct = 1;\r\nassert(isequal(set_diff(x,y) ,y_correct))\r\n%%\r\nx = 1:5;\r\ny = 2:6;\r\ny_correct = 6;\r\nassert(isequal(set_diff(y,x) ,y_correct))\r\n%%\r\nx=2:4;\r\ny=4:2;\r\ny_correct = [2 3 4];\r\nassert(isequal(set_diff(x,y) ,y_correct))\r\n%%\r\nx=0:4;\r\ny=2:4;\r\ny_correct = [0 1];\r\nassert(isequal(set_diff(x,y) ,y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":88,"test_suite_updated_at":"2015-01-24T08:02:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-24T07:58:49.000Z","updated_at":"2026-02-06T15:56:55.000Z","published_at":"2015-01-24T08:02:52.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\u003eFind difference of two set as per example\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\u003eSay x=[1:5] and y=[2: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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen, set_diff(x,y) should give output[1] and set_diff(y,x) should give output[6]\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":61195,"title":"Plus Cross Mandala","description":"Create a symmetrical plus (+) shaped pattern centered in an N×N matrix.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 383px 10.5px; text-align: left; transform-origin: 383px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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=\"\"\u003eCreate a symmetrical plus (+) shaped pattern centered in an N×N matrix.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = plus_cross(N)\r\ny = zeros(N);\r\nend\r\n","test_suite":"%% N = 5\r\nN = 5;\r\ny_correct = [0 0 1 0 0;\r\n             0 0 1 0 0;\r\n             1 1 1 1 1;\r\n             0 0 1 0 0;\r\n             0 0 1 0 0];\r\nassert(isequal(plus_cross(N),y_correct))\r\n\r\n%% N = 7\r\nN = 7;\r\ny_correct = [ 0     0     0     1     0     0     0\r\n              0     0     0     1     0     0     0\r\n              0     0     0     1     0     0     0\r\n              1     1     1     1     1     1     1\r\n              0     0     0     1     0     0     0\r\n              0     0     0     1     0     0     0\r\n              0     0     0     1     0     0     0];\r\nassert(isequal(plus_cross(N),y_correct))\r\n\r\n% N = 9\r\nN = 9;\r\ny_correct = [0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             1     1     1     1     1     1     1     1     1\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0\r\n             0     0     0     0     1     0     0     0     0];\r\nassert(isequal(plus_cross(N),y_correct))\r\n\r\n% N = 11\r\nN = 11;\r\ny_correct = [0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            1     1     1     1     1     1     1     1     1     1     1\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0\r\n            0     0     0     0     0     1     0     0     0     0     0];\r\nassert(isequal(plus_cross(N),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":2305225,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-02-02T10:12:11.000Z","updated_at":"2026-05-24T19:09:15.000Z","published_at":"2026-02-02T10:12:11.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\u003eCreate a symmetrical plus (+) shaped pattern centered in an N×N matrix.\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":42321,"title":"given number is power of n or not?","description":"Check weather The input is power of n or not?\r\nfor example \r\n\r\nx=8,n=2 --\u003e true\r\nx=6,n=2 --\u003e false","description_html":"\u003cp\u003eCheck weather The input is power of n or not?\r\nfor example\u003c/p\u003e\u003cp\u003ex=8,n=2 --\u0026gt; true\r\nx=6,n=2 --\u0026gt; false\u003c/p\u003e","function_template":"function y = Powerof(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 16; n=2\r\ny_correct = 'true';\r\nassert(isequal(Powerof(x,n),y_correct))\r\n\r\n%%\r\nx = 14; n=2\r\ny_correct = 'false';\r\nassert(isequal(Powerof(x,n),y_correct))\r\n\r\n%%\r\nx = 64; n=4\r\ny_correct = 'true';\r\nassert(isequal(Powerof(x,n),y_correct))\r\n\r\n%%\r\nx = 625; n=5\r\ny_correct = 'true';\r\nassert(isequal(Powerof(x,n),y_correct))\r\n\r\n%%\r\nx = 15; n=5\r\ny_correct = 'false';\r\nassert(isequal(Powerof(x,n),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":44104,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":84,"test_suite_updated_at":"2015-05-20T06:33:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-05-19T10:32:51.000Z","updated_at":"2026-03-04T13:49:11.000Z","published_at":"2015-05-19T10:32:51.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\u003eCheck weather The input is power of n or not? for example\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\u003ex=8,n=2 --\u0026gt; true x=6,n=2 --\u0026gt; false\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":43314,"title":"Change matrix to vector","description":"Vector is a matrix whose size is 1 x n or n x 1.\r\n\r\nChange matrix to vector.\r\n\r\n  x =\r\n  \r\n       4     3\r\n       5     1\r\n       5     1\r\n\r\ninput x should change to output y.\r\n\r\n  y =\r\n  \r\n       4\r\n       5\r\n       5\r\n       3\r\n       1\r\n       1","description_html":"\u003cp\u003eVector is a matrix whose size is 1 x n or n x 1.\u003c/p\u003e\u003cp\u003eChange matrix to vector.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex =\r\n\u003c/pre\u003e\u003cpre\u003e       4     3\r\n       5     1\r\n       5     1\u003c/pre\u003e\u003cp\u003einput x should change to output y.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey =\r\n\u003c/pre\u003e\u003cpre\u003e       4\r\n       5\r\n       5\r\n       3\r\n       1\r\n       1\u003c/pre\u003e","function_template":"function y = rearrange(x)\r\n  y =\r\nend","test_suite":"%%\r\nx = [  2     3\r\n       3     4\r\n       3     4];\r\ny_correct = [2;3;3;3;4;4];\r\nassert(isequal(rearrange(x),y_correct))\r\n\r\n%%\r\nx = [  4     3\r\n       5     1\r\n       5     1];\r\ny_correct = [4;5;5;3;1;1];\r\nassert(isequal(rearrange(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":204,"test_suite_updated_at":"2016-10-15T04:42:30.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T14:39:54.000Z","updated_at":"2026-02-11T18:22:52.000Z","published_at":"2016-10-10T14:39:54.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\u003eVector is a matrix whose size is 1 x n or n x 1.\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\u003eChange matrix to vector.\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 =\\n\\n       4     3\\n       5     1\\n       5     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\u003einput x should change to output y.\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[y =\\n\\n       4\\n       5\\n       5\\n       3\\n       1\\n       1]]\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":1258,"title":"Create matrix of replicated elements","description":"Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. \r\n\r\nExample:\r\n Input: repl_mat(2, 2, 5)\r\n Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];","description_html":"\u003cp\u003eGiven an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x.\u003c/p\u003e\u003cp\u003eExample:\r\n Input: repl_mat(2, 2, 5)\r\n Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];\u003c/p\u003e","function_template":"function y = repl_mat(x, m, n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\nm = 197;\r\nn = 535;\r\ny_correct = ones(m, n);\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = 0;\r\nm = 458;\r\nn = 535;\r\ny_correct = zeros(m, n);\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = 2;\r\nm = 1;\r\nn = 1;\r\ny_correct = 2;\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = -1;\r\nm = 1;\r\nn = 2;\r\ny_correct = [-1 -1];\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = 1.5;\r\nm = 2;\r\nn = 2;\r\ny_correct = [1.5 1.5; 1.5 1.5];\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n%%\r\nx = '1';\r\nm = 1;\r\nn = 3;\r\ny_correct = ['1' '1' '1'];\r\nassert(isequal(repl_mat(x, m, n),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":402,"test_suite_updated_at":"2013-02-10T21:51:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-10T21:46:34.000Z","updated_at":"2026-07-24T13:35:36.000Z","published_at":"2013-02-10T21:51:33.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\u003eGiven an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x.\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: Input: repl_mat(2, 2, 5) Output: [2, 2, 2, 2, 2; 2, 2, 2, 2, 2];\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":44654,"title":"convert the number to binary format \u0026 count digits","description":"Convert the given number to the corresponding binary format and count the number of digits in that binary number","description_html":"\u003cp\u003eConvert the given number to the corresponding binary format and count the number of digits in that binary number\u003c/p\u003e","function_template":"function y = dec_2_bin(x)\r\n \r\nend","test_suite":"%%\r\nx = 23;\r\ny_correct = 5;\r\nassert(isequal(dec_2_bin(x),y_correct))\r\n\r\n%%\r\nx = 234;\r\ny_correct = 8;\r\nassert(isequal(dec_2_bin(x),y_correct))\r\n\r\n%%\r\nx = 22;\r\ny_correct = 5;\r\nassert(isequal(dec_2_bin(x),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny_correct = 2;\r\nassert(isequal(dec_2_bin(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-25T11:50:28.000Z","updated_at":"2026-05-30T00:32:49.000Z","published_at":"2018-05-25T11:50:28.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\u003eConvert the given number to the corresponding binary format and count the number of digits in that binary number\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":2818,"title":"Remove and Sort","description":"Given a randomized array n, sort it and remove all odd integers.\r\n\r\nn=5\r\n\r\ny = [2 4]","description_html":"\u003cp\u003eGiven a randomized array n, sort it and remove all odd integers.\u003c/p\u003e\u003cp\u003en=5\u003c/p\u003e\u003cp\u003ey = [2 4]\u003c/p\u003e","function_template":"function x = rmv_srt(n)\r\nx=randperm(n)\r\n  \r\ny = x;\r\n\r\nend","test_suite":"%%\r\nn=10\r\nx = randperm(n);\r\ny_correct = [2 4 6 8 10];\r\nassert(isequal(rmv_srt(n),y_correct))\r\n%%\r\nn=25\r\nx = randperm(n);\r\ny_correct = [2 4 6 8 10 12 14 16 18 20 22 24];\r\nassert(isequal(rmv_srt(n),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":33703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":110,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-09T01:04:50.000Z","updated_at":"2026-02-27T14:06:01.000Z","published_at":"2015-01-09T01:06: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\",\"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\u003eGiven a randomized array n, sort it and remove all odd integers.\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\u003en=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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = [2 4]\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":43552,"title":"Calculate solution of given polynomial","description":"For example,\r\n\r\ny=function([3 -2 -4])\r\n\r\nIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\r\n\r\ny=[1.5352; -0.8685]","description_html":"\u003cp\u003eFor example,\u003c/p\u003e\u003cp\u003ey=function([3 -2 -4])\u003c/p\u003e\u003cp\u003eIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\u003c/p\u003e\u003cp\u003ey=[1.5352; -0.8685]\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [3 -2 -4];\r\ny_correct = [  1.5352\r\n              -0.8685];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx = [1 2 1];\r\ny_correct = [-1;-1];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx = [1 2 2];\r\ny_correct = [  -1.0000 + 1.0000i\r\n               -1.0000 - 1.0000i];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":"2016-10-15T04:16:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-14T11:53:24.000Z","updated_at":"2026-02-17T08:26:30.000Z","published_at":"2016-10-14T11:53:24.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\u003eFor example,\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=function([3 -2 -4])\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\u003eIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\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=[1.5352; -0.8685]\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":61270,"title":"Sum all elements of a vector or matrix without using  some built in functions","description":"Write a function that computes the sum of all elements of the input array v without using the following built-in function:\r\nsum, trace, mean, norm, diag, numel, size, ans,width,height\r\nThe input v may be a vector or a matrix of any size.\r\nIf the input is empty, the function must return 0.\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 141px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 468.5px 70.5px; transform-origin: 468.5px 70.5px; 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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 362.775px 8px; transform-origin: 362.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that computes the sum of all elements of the input array v without using the following built-in function:\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 184.75px 8px; transform-origin: 184.75px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esum, trace, mean, norm, diag, numel, size, ans,width,height\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 158.675px 8px; transform-origin: 158.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe input v may be a vector or a matrix of any size.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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: 145.317px 8px; transform-origin: 145.317px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf the input is empty, the function must return 0.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 444.5px 10.5px; text-align: left; transform-origin: 444.5px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext, 'sum')))\r\nassert(isempty(strfind(filetext, 'mean')))\r\nassert(isempty(strfind(filetext, 'norm')))\r\nassert(isempty(strfind(filetext, 'diag')))\r\nassert(isempty(strfind(filetext, 'numel')))\r\nassert(isempty(strfind(filetext, 'size')))\r\nassert(isempty(strfind(filetext, 'trace')))\r\nassert(isempty(strfind(filetext, 'width')))\r\nassert(isempty(strfind(filetext, 'height')))\r\nassert(isempty(strfind(filetext, 'ans')))\r\n%%\r\nx=[1 2 55;5 33 11];\r\ny_correct = 107;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx=[1 2 3 10];\r\ny_correct = 16;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx=[2 12 44 66 77;11 21 44 90 55];\r\ny_correct=422;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\n%%\r\nx=1:150;\r\ny_correct = 11325;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx=[1;4;7;9;101];\r\ny_correct=122;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx=[];\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":5046205,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-03-05T10:15:22.000Z","updated_at":"2026-06-06T17:53:57.000Z","published_at":"2026-03-05T10:15:21.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\u003eWrite a function that computes the sum of all elements of the input array v without using the following built-in function:\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\u003esum, trace, mean, norm, diag, numel, size, ans,width,height\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\u003eThe input v may be a vector or a matrix of any size.\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\u003eIf the input is empty, the function must return 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\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\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":44664,"title":"function to compute root mean square of first nn positive odd integers","description":"Write a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.","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: 84px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 42px; transform-origin: 407px 42px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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 42px; text-align: left; transform-origin: 384px 42px; 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: 367px 8px; transform-origin: 367px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function orms = odd_rms(nn)\r\n  \r\nend","test_suite":"%%\r\nnn = 3;\r\norms_correct = 3.4156\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)\r\n\r\n%%\r\nnn = 10;\r\norms_correct = 11.5325\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)\r\n\r\n%%\r\nnn = 1;\r\norms_correct = 1\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":"2021-12-31T17:41:47.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T15:13:46.000Z","updated_at":"2026-05-30T00:36:27.000Z","published_at":"2018-05-29T15:13:46.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\u003eWrite a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.\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":43134,"title":"Vector Multiplication ","description":"Vector Multiplication of three matrix as shown in test cases. ","description_html":"\u003cp\u003eVector Multiplication of three matrix as shown in test cases.\u003c/p\u003e","function_template":"function r = vec_mul(x,y,z)\r\n  r = x*y*z;\r\nend","test_suite":"%%\r\nx=[2 5];\r\ny=[5 6];\r\nz=[5 7];\r\ny_correct = [  50   210];\r\nassert(isequal(vec_mul(x,y,z),y_correct))\r\n\r\n%%\r\nx = [1 1 1 ];\r\ny=[1 1 1 ];\r\nz=[1 1 1];\r\ny_correct = [1 1 1];\r\nassert(isequal(vec_mul(x,y,z),y_correct))\r\n%%\r\nx = [1 2];\r\ny=[1 2];\r\nz=[1 2];\r\ny_correct = [1 8];\r\nassert(isequal(vec_mul(x,y,z),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny=1;\r\nz=1;\r\ny_correct = 1;\r\nassert(isequal(vec_mul(x,y,z),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":343,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T03:59:04.000Z","updated_at":"2026-07-04T11:42:18.000Z","published_at":"2016-10-07T03:59: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\",\"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\u003eVector Multiplication of three matrix as shown in test cases.\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":42592,"title":"Create cell array of strings","description":"Convert the input to a cell array, but only if necessary.\r\n\r\nIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.","description_html":"\u003cp\u003eConvert the input to a cell array, but only if necessary.\u003c/p\u003e\u003cp\u003eIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.\u003c/p\u003e","function_template":"function C = str2cell(S)\r\n  C = '';\r\nend","test_suite":"%%\r\nS = 'Testing, testing, 1, 2, 3';\r\nassert(isequal(str2cell(S),{S}))\r\n\r\n%%\r\nS = {'I','love','MATLAB'};\r\nassert(isequal(str2cell(S),S))\r\n\r\n%%\r\nS = datestr(now);\r\nassert(isequal(str2cell(S),{S}))\r\n\r\n%%\r\nfor ii=1:100\r\n  S = char(randi([97,122],1,100));\r\n  assert(isequal(str2cell(S),{S}))\r\nend\r\n\r\n%%\r\nfor ii=1:100\r\n  S = num2cell(char(randi([97,122],100,1)));\r\n  assert(isequal(str2cell(S),S))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-09T21:15:00.000Z","updated_at":"2026-05-28T13:57:38.000Z","published_at":"2015-09-09T21:15: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\",\"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\u003eConvert the input to a cell array, but only if necessary.\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\u003eIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.\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":42844,"title":"Detect pair of equal values in a Matrix","description":"A 2D matrix of 2 rows and N columns with random integer numbers.\r\n\r\n  \r\n    A = [3 1 2 4 6 6 7;\r\n\r\n         7 3 2 1 5 2 4]\r\n  \r\n\r\nin this Matrix, 3rd column has a pair of the same number.\r\n\r\nFunction return will be true/false.","description_html":"\u003cp\u003eA 2D matrix of 2 rows and N columns with random integer numbers.\u003c/p\u003e\u003cpre\u003e    A = [3 1 2 4 6 6 7;\u003c/pre\u003e\u003cpre\u003e         7 3 2 1 5 2 4]\u003c/pre\u003e\u003cp\u003ein this Matrix, 3rd column has a pair of the same number.\u003c/p\u003e\u003cp\u003eFunction return will be true/false.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [3 1 2 4 6 6 7;\r\n         7 3 2 1 5 2 4];\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [3 1 2 4 6 6 7;\r\n         7 3 6 1 5 2 4];\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":14921,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":74,"test_suite_updated_at":"2016-05-01T18:21:08.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-05-01T18:18:47.000Z","updated_at":"2026-02-26T12:22:37.000Z","published_at":"2016-05-01T18:21:08.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\u003eA 2D matrix of 2 rows and N columns with random integer numbers.\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 1 2 4 6 6 7;\\n\\n         7 3 2 1 5 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\u003ein this Matrix, 3rd column has a pair of the same 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\u003eFunction return will be true/false.\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":43308,"title":"Calculate some equation","description":"Using given inputs x and z, make two outputs that are\r\n\r\n y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\r\n\r\n y2 = x^z - z^x + (x/z)^2 - (z/x)^2\r\n\r\n","description_html":"\u003cp\u003eUsing given inputs x and z, make two outputs that are\u003c/p\u003e\u003cpre\u003e y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\u003c/pre\u003e\u003cpre\u003e y2 = x^z - z^x + (x/z)^2 - (z/x)^2\u003c/pre\u003e","function_template":"function [y1 y2] = calculate_eq(x,z)\r\n  y1 =\r\n  y2 =  \r\nend","test_suite":"%%\r\nx = 1;\r\nz = 1;\r\ny1=14.2000\r\ny2=0\r\n\r\n[y11,y22]=calculate_eq(x,z)\r\nassert( abs(y1-y11)+abs(y2-y22)\u003c0.001 )\r\n\r\n\r\n%%\r\nx = 2;\r\nz = 1;\r\ny1= 55.7000\r\ny2=4.7500\r\n\r\n[y11,y22]=calculate_eq(x,z)\r\nassert( abs(y1-y11)+abs(y2-y22)\u003c0.001 )\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":"2016-10-15T04:52:37.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T13:09:03.000Z","updated_at":"2026-02-18T21:55:46.000Z","published_at":"2016-10-10T13:09:03.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\u003eUsing given inputs x and z, make two outputs that are\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[ y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\\n\\n y2 = x^z - z^x + (x/z)^2 - (z/x)^2]]\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":43174,"title":"Change string to number","description":"Change given string to number. (hint: there is already function)\r\n\r\nChanging from ['1234'] to [1234] is one of example","description_html":"\u003cp\u003eChange given string to number. (hint: there is already function)\u003c/p\u003e\u003cp\u003eChanging from ['1234'] to [1234] is one of example\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = '1';\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":230,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T18:22:17.000Z","updated_at":"2026-07-24T17:45:00.000Z","published_at":"2016-10-07T18:22:17.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\u003eChange given string to number. (hint: there is already function)\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\u003eChanging from ['1234'] to [1234] is one of example\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":44548,"title":"ASCII sum of phrases","description":"Find the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array:\r\n[77   121    32   110    97   109   101    32   105   115    32   116   101   115   116] i.e. 1379","description_html":"\u003cp\u003eFind the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array:\r\n[77   121    32   110    97   109   101    32   105   115    32   116   101   115   116] i.e. 1379\u003c/p\u003e","function_template":"function y = str_to_number(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'Tilda : ~';\r\ny_correct = 742;\r\nassert(isequal(str_to_number(x),742))\r\n%%\r\nx = 'Practise more';\r\ny_correct = 1294;\r\nassert(isequal(str_to_number(x),1294))\r\n%%\r\nx = '1 last test';\r\ny_correct = 997;\r\nassert(isequal(str_to_number(x),997))\r\n%%\r\nx = 'OK, Definitely the last!';\r\ny_correct = 997;\r\nassert(isequal(str_to_number(x),2121))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-02T16:01:56.000Z","updated_at":"2026-05-29T04:26:48.000Z","published_at":"2018-04-02T16:01:56.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\u003eFind the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array: [77 121 32 110 97 109 101 32 105 115 32 116 101 115 116] i.e. 1379\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":43488,"title":"Print true if ","description":"all elements are larger than 5\r\n\r\n  a=[1 3 5 8 6];\r\n  b=[6 6 6 6 6];\r\n\r\nfunction(a) should be false, and function(b) will be true.\r\n","description_html":"\u003cp\u003eall elements are larger than 5\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea=[1 3 5 8 6];\r\nb=[6 6 6 6 6];\r\n\u003c/pre\u003e\u003cp\u003efunction(a) should be false, and function(b) will be true.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [6 6 6 6 6 6 6 6 ];\r\ny_correct = true;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [6 6 6 1 6 6 6 6 ];\r\ny_correct = false;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [6 6 9 6 6 6 9 1 ];\r\ny_correct = false;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":153,"test_suite_updated_at":"2016-10-15T04:19:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-12T13:22:38.000Z","updated_at":"2026-07-24T17:51:14.000Z","published_at":"2016-10-12T13:22:38.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\u003eall elements are larger than 5\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 3 5 8 6];\\nb=[6 6 6 6 6];]]\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\u003efunction(a) should be false, and function(b) will be true.\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":42499,"title":"Is it column vector?","description":"Is it column vector? \r\n\r\nCheck vector for column vector without using iscolumn function. ","description_html":"\u003cp\u003eIs it column vector?\u003c/p\u003e\u003cp\u003eCheck vector for column vector without using iscolumn function.\u003c/p\u003e","function_template":"function y = iscol(x)\r\n  y = x;\r\nend","test_suite":"%%\r\n\r\nfiletext = fileread('iscol.m');\r\nassert(isempty(strfind(filetext, 'iscolumn(')),'mean forbidden')\r\nassert(isempty(strfind(filetext, 'iscolumn (')),'mean forbidden')\r\nassert(isempty(strfind(filetext, '...')),'... forbidden')\r\n\r\n%%\r\nx = [2 3];\r\ny_correct = 0;\r\nassert(isequal(iscol(x),y_correct))\r\n\r\n%%\r\nx = [2 3]';\r\ny_correct = 1;\r\nassert(isequal(iscol(x),y_correct))\r\n\r\n%%\r\nx = [1];\r\ny_correct = 1;\r\nassert(isequal(iscol(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":209,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-08T09:55:22.000Z","updated_at":"2026-02-16T12:27:17.000Z","published_at":"2015-08-08T09:55:22.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\u003eIs it column 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\u003eCheck vector for column vector without using iscolumn function.\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":46908,"title":"Product of elements in a column","description":null,"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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eif x=[1 2 3\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e        3 4 5\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e        1 2 1] do the product of all the elements in a column such that your answer should be y=[3 16 15]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx =[1 2 3;3 4 5;1 2 1];\r\ny_correct = [3 16 15];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx =[1 8 9 4;1 26 7 5];\r\ny_correct = [1 208 63 20];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx =[10 20;30 40];\r\ny_correct = [300 800];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx =[10 30;20 40];\r\ny_correct = [200 1200];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":628208,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2020-10-23T09:06:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-18T10:24:59.000Z","updated_at":"2026-05-31T17:42:26.000Z","published_at":"2020-10-23T09:06:17.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\u003eif x=[1 2 3\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        3 4 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e        1 2 1] do the product of all the elements in a column such that your answer should be y=[3 16 15]\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":42324,"title":"Accessing value of variable whose name is stored in another variable as string.","description":"Accessing value of variable whose name is stored in another variable as string.\r\nfor example:\r\nvar1=n;\r\nvar2='var1';  %Assigning var1 as a string\r\nvar3= var2;  %want to give var1 value to var3 with out using var1 variable.\r\n\r\n% do not give var3=n or var3=var1l","description_html":"\u003cp\u003eAccessing value of variable whose name is stored in another variable as string.\r\nfor example:\r\nvar1=n;\r\nvar2='var1';  %Assigning var1 as a string\r\nvar3= var2;  %want to give var1 value to var3 with out using var1 variable.\u003c/p\u003e\u003cp\u003e% do not give var3=n or var3=var1l\u003c/p\u003e","function_template":"function var3 = varaccess(n)\r\n  var3='var1';\r\nend","test_suite":"%%\r\nn = 10;\r\nvar3_correct = 10;\r\nassert(isequal(varaccess(n),var3_correct))\r\n\r\n%%\r\nn = 30;\r\nvar3_correct = 30;\r\nassert(isequal(varaccess(n),var3_correct))\r\n\r\n%%\r\nn = 0.6;\r\nvar3_correct = 0.6;\r\nassert(isequal(varaccess(n),var3_correct))\r\n\r\n%%\r\nn = 500;\r\nvar3_correct = 500;\r\nassert(isequal(varaccess(n),var3_correct))\r\n\r\n%%\r\nn = 7.8;\r\nvar3_correct = 7.8;\r\nassert(isequal(varaccess(n),var3_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":44104,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":50,"test_suite_updated_at":"2015-05-21T12:08:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-05-21T11:59:24.000Z","updated_at":"2026-02-25T10:45:16.000Z","published_at":"2015-05-21T11:59:38.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\u003eAccessing value of variable whose name is stored in another variable as string. for example: var1=n; var2='var1'; %Assigning var1 as a string var3= var2; %want to give var1 value to var3 with out using var1 variable.\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% do not give var3=n or var3=var1l\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":3107,"title":"Try and Catch Simple Example","description":"Try and Catch Simple Example \r\n\r\n\u003chttp://in.mathworks.com/help/matlab/ref/try.html Example\u003e \r\n\r\nVector x=[1 4 6 8 10];\r\n\r\nCreate a function using try and catch, if user asks index 0 or negative or more than the length, then display zero otherwise value of x. \r\n","description_html":"\u003cp\u003eTry and Catch Simple Example\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://in.mathworks.com/help/matlab/ref/try.html\"\u003eExample\u003c/a\u003e\u003c/p\u003e\u003cp\u003eVector x=[1 4 6 8 10];\u003c/p\u003e\u003cp\u003eCreate a function using try and catch, if user asks index 0 or negative or more than the length, then display zero otherwise value of x.\u003c/p\u003e","function_template":"function y = trcatch(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 4 6 8 10];\r\nn=1;\r\ny_correct = 1;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n%% \r\nfiletext = fileread('trcatch.m');\r\nassert(~isempty(strfind(filetext, 'try')),'try missing')\r\nassert(~isempty(strfind(filetext, 'catch')),'Catch missing')\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=0;\r\ny_correct = 0;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=6;\r\ny_correct = 0;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=5;\r\ny_correct = 10;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=-25;\r\ny_correct = 0;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n\r\n%%\r\nx = [1 4 6 8 10];\r\nn=3;\r\ny_correct = 6;\r\nassert(isequal(trcatch(x,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":135,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-03-23T09:12:50.000Z","updated_at":"2026-02-17T08:52:20.000Z","published_at":"2015-03-23T09:12:50.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\u003eTry and Catch Simple Example\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:hyperlink w:docLocation=\\\"http://in.mathworks.com/help/matlab/ref/try.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\u003eVector x=[1 4 6 8 10];\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\u003eCreate a function using try and catch, if user asks index 0 or negative or more than the length, then display zero otherwise value of x.\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":42593,"title":"Create cell array of numeric arrays","description":"Convert the input to a cell array, but only if necessary.\r\n\r\nIf the input is a numeric array, return a 1-by-1 cell array containing the input. If the input is a cell array of numeric arrays, return the input unaltered.","description_html":"\u003cp\u003eConvert the input to a cell array, but only if necessary.\u003c/p\u003e\u003cp\u003eIf the input is a numeric array, return a 1-by-1 cell array containing the input. If the input is a cell array of numeric arrays, return the input unaltered.\u003c/p\u003e","function_template":"function y = cellnum(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = rand;\r\nassert(isequal(cellnum(x),{x}))\r\n\r\n%%\r\nfor ii=1:10\r\n  x = rand(1,randi([2 100]));\r\n  assert(isequal(cellnum(x),{x}))\r\nend\r\n\r\n%%\r\nfor ii=1:10\r\n  x = rand(randi([2 100]),1);\r\n  assert(isequal(cellnum(x),{x}))\r\nend\r\n\r\n%%\r\nfor ii=2:10\r\n  x = magic(ii);\r\n  assert(isequal(cellnum(x),{x}))\r\nend\r\n\r\n%%\r\nfor ii=1:10\r\n  x = num2cell(rand(1,randi(100)));\r\n  assert(isequal(cellnum(x),x))\r\nend\r\n\r\n%%\r\nx = mat2cell(hankel(1:100),[10*ones(1,10)],[10*ones(1,10)]);\r\nassert(isequal(cellnum(x(:)),x(:)))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":46,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-09T21:46:25.000Z","updated_at":"2026-05-28T13:57:39.000Z","published_at":"2015-09-09T21:46:25.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\u003eConvert the input to a cell array, but only if necessary.\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\u003eIf the input is a numeric array, return a 1-by-1 cell array containing the input. If the input is a cell array of numeric arrays, return the input unaltered.\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":1667,"title":"What number has this problem?","description":"This problem is added because it is problem number *???* in the \"Community\" problems section.\r\n\r\n\u003chttp://www.mathworks.de/matlabcentral/cody/?sort=\u0026term=group%3ACommunity A lots of problems here!\u003e\r\n\r\n\r\nThank you, Community!\r\n\r\nand... \r\n\r\nThank you Matlab!!","description_html":"\u003cp\u003eThis problem is added because it is problem number \u003cb\u003e???\u003c/b\u003e in the \"Community\" problems section.\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.de/matlabcentral/cody/?sort=\u0026term=group%3ACommunity\"\u003eA lots of problems here!\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThank you, Community!\u003c/p\u003e\u003cp\u003eand...\u003c/p\u003e\u003cp\u003eThank you Matlab!!\u003c/p\u003e","function_template":"function nr = celebrating_Problem()\r\n  nr = ???;\r\nend","test_suite":"%%\r\nweCelebrateProblemNumber = 1000;\r\nassert(isequal(celebrating_Problem(),weCelebrateProblemNumber))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":3038,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":405,"test_suite_updated_at":"2013-06-20T22:47:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-20T22:38:15.000Z","updated_at":"2026-05-05T18:09:22.000Z","published_at":"2013-06-20T22:47: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\u003eThis problem is added because it is problem number\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\u003e???\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in the \\\"Community\\\" problems section.\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:hyperlink w:docLocation=\\\"http://www.mathworks.de/matlabcentral/cody/?sort=\u0026amp;term=group%3ACommunity\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eA lots of problems here!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\u003eThank you, Community!\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\u003eand...\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\u003eThank you Matlab!!\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":2604,"title":"Gamma Function ","description":"Evaluate the \u003chttp://en.wikipedia.org/wiki/Gamma_function/ Gamma Function\u003e.\r\n\r\n Gamma_val(0)   = Inf\r\n Gamma_val(1.2) = 0.9182","description_html":"\u003cp\u003eEvaluate the \u003ca href = \"http://en.wikipedia.org/wiki/Gamma_function/\"\u003eGamma Function\u003c/a\u003e.\u003c/p\u003e\u003cpre\u003e Gamma_val(0)   = Inf\r\n Gamma_val(1.2) = 0.9182\u003c/pre\u003e","function_template":"function y = Gamma_val(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(Gamma_val(x),y_correct))\r\n%%\r\nx = 0;\r\ny_correct = Inf;\r\nassert(isequal(Gamma_val(x),y_correct))\r\n%%\r\nx = 1.2;\r\ny_correct = 0.9182;\r\nassert(abs(Gamma_val(x)-y_correct)\u003c0.0001)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":120,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-09-26T13:31:41.000Z","updated_at":"2026-02-20T14:14:09.000Z","published_at":"2014-09-26T13:31:41.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\u003eEvaluate 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=\\\"http://en.wikipedia.org/wiki/Gamma_function/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGamma Function\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Gamma_val(0)   = Inf\\n Gamma_val(1.2) = 0.9182]]\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":61030,"title":"The MATLAB Treasure Hunt – Decode the First Clue Hidden in a Jumbled Sequence of Numbers","description":"You discover an ancient parchment inside the college archives. It contains a jumbled sequence of numbers that seems meaningless — until you notice faint MATLAB-like symbols next to it!\r\nYour first task is to decode the clue by arranging the numbers in ascending order. The smallest number might mark the beginning of the treasure trail.\r\nGiven a row vector a, return another vector b containing all elements of a sorted in increasing order.","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; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 123px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 61.5px; transform-origin: 408px 61.5px; 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: 385px 21px; text-align: left; transform-origin: 385px 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 discover an ancient parchment inside the college archives. It contains a jumbled sequence of numbers that seems meaningless — until you notice faint MATLAB-like symbols next to it!\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: 385px 21px; text-align: left; transform-origin: 385px 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=\"\"\u003eYour first task is to \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; \"\u003edecode the clue\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 by arranging the numbers in \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; \"\u003eascending 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. The smallest number might mark the beginning of the treasure trail.\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: 385px 10.5px; text-align: left; transform-origin: 385px 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=\"\"\u003eGiven a row vector \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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ea\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, return another vector \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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003eb\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 containing all elements of \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-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ea\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 sorted in increasing order.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = firstClue(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = [42 7 13 5 19];\r\ny_correct = [5 7 13 19 42];\r\nassert(isequal(firstClue(a),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":4953963,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":122,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-10-21T09:21:20.000Z","updated_at":"2026-07-22T17:12:06.000Z","published_at":"2025-10-21T09:21:20.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\u003eYou discover an ancient parchment inside the college archives. It contains a jumbled sequence of numbers that seems meaningless — until you notice faint MATLAB-like symbols next to it!\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\u003eYour first task is to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edecode the clue\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e by arranging the numbers in \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eascending order\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. The smallest number might mark the beginning of the treasure trail.\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\u003eGiven a row vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, return another vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e containing all elements of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e sorted in increasing order.\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":1943,"title":"Signed Magnitude","description":"For a given input vector, return the value that is furthest from zero. \r\n\r\nFor example, if \r\n\r\nx = [1 2 -12] \r\n\r\nreturn -12.","description_html":"\u003cp\u003eFor a given input vector, return the value that is furthest from zero.\u003c/p\u003e\u003cp\u003eFor example, if\u003c/p\u003e\u003cp\u003ex = [1 2 -12]\u003c/p\u003e\u003cp\u003ereturn -12.\u003c/p\u003e","function_template":"function y = signed_mag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 -12];\r\ny_correct = -12;\r\nassert(isequal(signed_mag(x),y_correct))\r\n\r\n\r\n%%\r\nx = [1 10 20];\r\ny_correct = 20;\r\nassert(isequal(signed_mag(x),y_correct))\r\n\r\n\r\n%%\r\nx = [0 0.1 -0.2];\r\ny_correct = -0.2;\r\nassert(isequal(signed_mag(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":17734,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":135,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-10-18T16:05:08.000Z","updated_at":"2026-02-17T14:57:13.000Z","published_at":"2013-10-18T16:05:08.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\u003eFor a given input vector, return the value that is furthest from zero.\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\u003eFor example, if\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\u003ex = [1 2 -12]\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\u003ereturn -12.\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":44659,"title":"Nth root of a number","description":"Given an input and a number N, find the Nth root of the number(s)","description_html":"\u003cp\u003eGiven an input and a number N, find the Nth root of the number(s)\u003c/p\u003e","function_template":"function y = rootN(a,N)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\nN = 100\r\ny_correct = 1;\r\nassert(isequal(rootN(a,N),y_correct))\r\n\r\n%%\r\na = [1 64 216];\r\nN = 3\r\ny_correct = [1    4    6];\r\nassert(isequal(rootN(a,N),y_correct))\r\n\r\n%%\r\na = 1/100;\r\nN = 2\r\ny_correct = 1/10;\r\nassert(isequal(rootN(a,N),y_correct))\r\n\r\n%%\r\na = 826^10;\r\nN = 10\r\ny_correct = 826;\r\nassert(isequal(rootN(a,N),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":61,"test_suite_updated_at":"2018-05-29T13:54:08.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T13:48:03.000Z","updated_at":"2026-05-30T00:36:23.000Z","published_at":"2018-05-29T13:48:03.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\u003eGiven an input and a number N, find the Nth root of the number(s)\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":43190,"title":"Determine point is located in a circle or not","description":"Using input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\r\nif point is located in circle, output is true.","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; 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: 269px 8px; transform-origin: 269px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsing input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\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: 126.5px 8px; transform-origin: 126.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eif point is located in circle, output is true.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = inorout(x,y)\r\n  z=true\r\nend","test_suite":"%%\r\nx = 1;\r\ny = 2;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny = 0;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 0.5;\r\ny = 0.5;\r\ny_correct = 1;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = -1;\r\ny = -1;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 0;\r\ny = 0;\r\ny_correct = 1;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny = 3;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":223089,"edited_at":"2022-09-09T07:58:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2022-09-09T07:58:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T06:42:36.000Z","updated_at":"2026-02-18T10:12:49.000Z","published_at":"2016-10-08T06:42:36.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\u003eUsing input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\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\u003eif point is located in circle, output is true.\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":1264,"title":"Center of mass","description":"Given a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid). M contains coordinates of the vertices C=[x,y,z].\r\n\r\nFind C, the center of mass of the element.","description_html":"\u003cp\u003eGiven a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid). M contains coordinates of the vertices C=[x,y,z].\u003c/p\u003e\u003cp\u003eFind C, the center of mass of the element.\u003c/p\u003e","function_template":"function C = centroid(M)\r\n\r\nend","test_suite":"%%\r\nx = [0,0,0 ; 0,0,1 ; 0,1,0 ; 0,1,1 ; 1,0,0 ; 1,0,1 ; 1,1,0 ; 1,1,1];\r\ny_correct = [0.5,0.5,0.5];\r\nassert(isequal(centroid(x),y_correct))\r\n\r\n%%\r\nx = [0,0 ; 0.5,3 ; 1,0];\r\ny_correct = [0.5,1];\r\nassert(isequal(centroid(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":3919,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":190,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-12T09:26:23.000Z","updated_at":"2026-07-24T14:10:22.000Z","published_at":"2013-02-12T09:26:33.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\u003eGiven a matrix M(m,n), where m is the number of vertices of the geometrical element and n is 2 or 3 (2D-plane figure or 3D-solid). M contains coordinates of the vertices C=[x,y,z].\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\u003eFind C, the center of mass of the element.\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":1230,"title":"Who is the smartest MATLAB programmer?","description":"Who is the smartest MATLAB programmer?\r\n\r\nExamples:\r\n\r\n  Input x = 'Is it Obama?'\r\n  Output = 'Me!'\r\n\r\n  Input x = 'Who ?'\r\n  Output = 'Me!'\r\n\r\nReturn 'Me!' to all inputs. (Note: this is only a joke!)","description_html":"\u003cp\u003eWho is the smartest MATLAB programmer?\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput x = 'Is it Obama?'\r\nOutput = 'Me!'\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eInput x = 'Who ?'\r\nOutput = 'Me!'\r\n\u003c/pre\u003e\u003cp\u003eReturn 'Me!' to all inputs. (Note: this is only a joke!)\u003c/p\u003e","function_template":"function y = smartest(x)\r\n  y = 'Not me!';\r\nend","test_suite":"%%\r\nx = 'I have been using MATLAB for 50 years!';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = 'I developed MATLAB!';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = '';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":3,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":793,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-30T01:41:14.000Z","updated_at":"2026-06-19T12:49:54.000Z","published_at":"2013-01-30T01:41: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\u003eWho is the smartest MATLAB programmer?\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\u003eExamples:\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 x = 'Is it Obama?'\\nOutput = 'Me!'\\n\\nInput x = 'Who ?'\\nOutput = 'Me!']]\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\u003eReturn 'Me!' to all inputs. (Note: this is only a joke!)\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":43740,"title":"Create a New_Word","description":"The output of the function is a new word created from the word entered into the function. The new word is created by deleting the first letter, taking the last 2 letters and moving them to the front, and adding y to the end. ","description_html":"\u003cp\u003eThe output of the function is a new word created from the word entered into the function. The new word is created by deleting the first letter, taking the last 2 letters and moving them to the front, and adding y to the end.\u003c/p\u003e","function_template":"function y = New_Word(Old_Word)\r\n  y = Old_Word;\r\nend","test_suite":"%%\r\nOld_Word = 'Welcome';\r\ny_correct = 'meelcoy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Pertinacious';\r\ny_correct = 'usertinacioy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Homogenous';\r\ny_correct = 'usomogenoy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Homologous';\r\ny_correct = 'usomologoy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Extemperaneous';\r\ny_correct = 'usxtemperaneoy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))\r\n%%\r\nOld_Word = 'Deterministic';\r\ny_correct = 'iceterministy';\r\nassert(strcmp(New_Word(Old_Word),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":100857,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":54,"test_suite_updated_at":"2016-12-22T18:10:34.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-07T16:56:19.000Z","updated_at":"2026-05-29T02:43:19.000Z","published_at":"2016-12-07T16:56: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\",\"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\u003eThe output of the function is a new word created from the word entered into the function. The new word is created by deleting the first letter, taking the last 2 letters and moving them to the front, and adding y to the end.\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\"}]}"}],"errors":[],"facets":[[{"value":"Cody Challenge","count":26,"selected":false},{"value":"Radar Basics","count":10,"selected":false},{"value":"Treasure Hunt","count":10,"selected":false},{"value":"Mandala Patterns ","count":7,"selected":false},{"value":"The Detective Mystery","count":5,"selected":false},{"value":"Basics on π","count":3,"selected":false},{"value":"Strings II","count":3,"selected":false},{"value":"Basics - Binary Logic","count":2,"selected":false},{"value":"Basics - Cell Arrays","count":2,"selected":false},{"value":"Basics - Rounding","count":2,"selected":false},{"value":"Image Functions","count":2,"selected":false},{"value":"Logic","count":2,"selected":false},{"value":"Matrix Patterns II","count":2,"selected":false},{"value":"Number theory","count":2,"selected":false},{"value":"Physics","count":2,"selected":false},{"value":"Algorithm I","count":1,"selected":false},{"value":"Basics - Prime Numbers","count":1,"selected":false},{"value":"Basics on Vectors","count":1,"selected":false},{"value":"Board Games I","count":1,"selected":false},{"value":"Board Games II","count":1,"selected":false},{"value":"Chess","count":1,"selected":false},{"value":"Classic Game Puzzles","count":1,"selected":false},{"value":"Computational Geometry III","count":1,"selected":false},{"value":"Date \u0026 Time II","count":1,"selected":false},{"value":"High School Challenge","count":1,"selected":false},{"value":"Indexing II","count":1,"selected":false},{"value":"Indexing V","count":1,"selected":false},{"value":"Introduction to MATLAB","count":1,"selected":false},{"value":"M3 Challenge Problem Group","count":1,"selected":false},{"value":"MATLAB Fundamentals - Plotting and Visualization","count":1,"selected":false},{"value":"Magic Numbers","count":1,"selected":false},{"value":"Magic Numbers II","count":1,"selected":false},{"value":"Matrix Manipulation II","count":1,"selected":false},{"value":"Matrix Patterns III","count":1,"selected":false},{"value":"Number Manipulation I","count":1,"selected":false},{"value":"Number Manipulation III","count":1,"selected":false},{"value":"Probability \u0026 Stats","count":1,"selected":false},{"value":"Programky","count":1,"selected":false},{"value":"Project Euler IV","count":1,"selected":false},{"value":"Tough Stuff","count":1,"selected":false}],[{"value":"medium","count":98,"selected":false},{"value":"easy","count":95,"selected":false},{"value":"hard","count":10,"selected":false}]],"term":"tag:\"matlab\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}