{"id":19014,"date":"2026-11-17T17:09:54","date_gmt":"2026-11-17T22:09:54","guid":{"rendered":"https:\/\/blogs.mathworks.com\/simulink\/?p=19014"},"modified":"2026-11-17T17:09:54","modified_gmt":"2026-11-17T22:09:54","slug":"debugging-simulation-results-with-an-ai-coding-agent","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2026\/11\/17\/debugging-simulation-results-with-an-ai-coding-agent\/","title":{"rendered":"Debugging Simulation Results with an AI Coding Agent"},"content":{"rendered":"<div class = rtcContent><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = \"https:\/\/matlab.mathworks.com\/open\/github\/v1?repo=simulink\/blog&amp;file=2026_11_16_Debugging_with_AI\\matlab.toml\"><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_1.png\" width = \"136\" height = \"21\" alt = \"\" style = \"vertical-align: baseline; width: 136px; height: 21px;\"><\/img><\/a><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">I have to admit, in my day-to-day work, I spend a lot more time debugging Simulink models that produce unexpected results than creating new ones. Since I have access to AI coding agents, I have had a lot of success speeding up debugging sessions and getting deeper insights than I could have dreamed of before.<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">Today I decided to share one example of this kind of debugging.<\/span><\/div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class=\"_richTextNode\">The problem<\/span><\/h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">A colleague reached out saying they were trying to apply the technique I described in <\/span><a href = \"https:\/\/blogs.mathworks.com\/simulink\/2023\/10\/05\/getting-the-most-out-of-rapid-accelerator-mode-version-r2023b\/\"><span class=\"_richTextNode\">Getting the most out of Rapid Accelerator mode<\/span><\/a><span class=\"_richTextNode\">, but they were getting unexpected results. The model was made of more than 100,000 blocks from many different blocksets and used thousands of parameters. <\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">We offer many tools, diagnostics, and documentation pages to understand and debug this type of issue. Even with all those resources, running into an issue like this one can be intimidating.<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">For this blog post, I reproduced the original problem in a smaller project, using a slightly modified version of the Simscape Driveline example <\/span><a href = \"https:\/\/www.mathworks.com\/help\/sdl\/ug\/series-hybrid-transmission.html\"><span class=\"_richTextNode\">Series Hybrid Transmission<\/span><\/a><span class=\"_richTextNode\">.<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_2.png\" width = \"551\" height = \"303\" alt = \"\" style = \"vertical-align: baseline; width: 551px; height: 303px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">I stored most of the variables needed by the model in a data dictionary:<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_3.png\" width = \"554\" height = \"456\" alt = \"\" style = \"vertical-align: baseline; width: 554px; height: 456px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">Then I created a second parameter set with different values for most variables.<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_4.png\" width = \"376\" height = \"330\" alt = \"\" style = \"vertical-align: baseline; width: 376px; height: 330px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">I simulated the model with both parameter sets in Normal mode and in Rapid Accelerator mode. For the Rapid Accelerator runs, I set <\/span><span class=\"_richTextNode\" style=' font-family: monospace;'>RapidAcceleratorUpToDateCheck<\/span><span class=\"_richTextNode\"> to <\/span><span class=\"_richTextNode\" style=' font-family: monospace;'>off<\/span><span class=\"_richTextNode\"> for maximum performance.<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >mdl = <\/span><span style=\"color: rgb(167, 9, 245);\">'SeriesHybridTransmission'<\/span><span >;<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >in = repmat(Simulink.SimulationInput(mdl),4,1);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >Simulink.BlockDiagram.buildRapidAcceleratorTarget(mdl);<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsTextElement\" uid=\"04F64089\" prevent-scroll=\"true\" data-testid=\"output_0\" style=\"width: 1178px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\" tabindex=\"-1\"><div class=\"textElement eoOutputContent\" tabindex=\"-1\" data-previous-available-width=\"1141\" data-previous-scroll-height=\"46\" data-hashorizontaloverflow=\"false\" role=\"article\" aria-roledescription=\"Use Browse Mode to explore \" aria-description=\"text output \" style=\"max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;\">### Searching for referenced models in model 'SeriesHybridTransmission'.\r\n### Total of 1 models to build.\r\n### Starting top model simulation target build for: SeriesHybridTransmission<\/div><\/div><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >in(1) = in(1).setModelParameter(<\/span><span style=\"color: rgb(167, 9, 245);\">'SimulationMode'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'Normal'<\/span><span >);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >in(2) = in(2).setModelParameter(<\/span><span style=\"color: rgb(167, 9, 245);\">'SimulationMode'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'Normal'<\/span><span >);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >in(2) = in(2).loadVariablesFromMATFile(<\/span><span style=\"color: rgb(167, 9, 245);\">'SeriesHybridTransmission_alternate_variables.mat'<\/span><span >);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >in(3) = in(3).setModelParameter(<\/span><span style=\"color: rgb(167, 9, 245);\">'SimulationMode'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'Rapid'<\/span><span >,<\/span><span style=\"color: rgb(14, 0, 255);\">...<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: rgb(167, 9, 245);\">'RapidAcceleratorUpToDateCheck'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'off'<\/span><span >);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >in(4) = in(4).loadVariablesFromMATFile(<\/span><span style=\"color: rgb(167, 9, 245);\">'SeriesHybridTransmission_alternate_variables.mat'<\/span><span >);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >in(4) = in(4).setModelParameter(<\/span><span style=\"color: rgb(167, 9, 245);\">'SimulationMode'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'Rapid'<\/span><span >,<\/span><span style=\"color: rgb(14, 0, 255);\">...<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: rgb(167, 9, 245);\">'RapidAcceleratorUpToDateCheck'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'off'<\/span><span >);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >out = sim(in,<\/span><span style=\"color: rgb(167, 9, 245);\">'ShowProgress'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'off'<\/span><span >);<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >figure<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >hold <\/span><span style=\"color: rgb(167, 9, 245);\">on<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >styles = {<\/span><span style=\"color: rgb(167, 9, 245);\">'-'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'-'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'o'<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">'o'<\/span><span >};<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span style=\"color: rgb(14, 0, 255);\">for <\/span><span >i=1:4<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >&nbsp;&nbsp;&nbsp;&nbsp;plot(out(i).logsout.get(<\/span><span style=\"color: rgb(167, 9, 245);\">'Velocity'<\/span><span >).Values,styles{i})<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span style=\"color: rgb(14, 0, 255);\">end<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >legend({<\/span><span style=\"color: rgb(167, 9, 245);\">'Normal - Dataset 1'<\/span><span >,<\/span><span style=\"color: rgb(14, 0, 255);\">...<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: rgb(167, 9, 245);\">'Normal - Dataset 2'<\/span><span >,<\/span><span style=\"color: rgb(14, 0, 255);\">...<\/span><\/span><\/div><\/div><div class=\"inlineWrapper\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: rgb(167, 9, 245);\">'Rapid Accelerator - Dataset 1'<\/span><span >,<\/span><span style=\"color: rgb(14, 0, 255);\">...<\/span><\/span><\/div><\/div><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: rgb(167, 9, 245);\">'Rapid Accelerator - Dataset 2'<\/span><span >},<\/span><span style=\"color: rgb(167, 9, 245);\">\"Location\"<\/span><span >,<\/span><span style=\"color: rgb(167, 9, 245);\">\"northwest\"<\/span><span >);<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsFigure\" uid=\"B4C739C6\" prevent-scroll=\"true\" data-testid=\"output_1\" style=\"width: 1178px;\" tabindex=\"-1\"><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\" aria-hidden=\"true\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\" aria-hidden=\"true\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" aria-hidden=\"false\" role=\"application\" tabindex=\"-1\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\" aria-hidden=\"false\" role=\"application\"><\/div><div class=\"figureElement eoOutputContent\" role=\"article\" aria-roledescription=\"Use Browse Mode to explore \" aria-description=\"figure output \"><img decoding=\"async\" class=\"figureImage figureContainingNode\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_5.png\" style=\"width: 560px;\"><\/div><\/div><\/div><\/div><\/div><div  style = 'margin: 10px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">Looking at the results, we can see that the Normal and Rapid Accelerator results match for parameter set 1. The run in Normal mode with parameter set 2 returns expected results, but the run in Rapid Accelerator mode with parameter set 2 gives unexpected results.<\/span><\/div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class=\"_richTextNode\">Asking for help<\/span><\/h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">A year ago, I would have started manually digging into that. This time, I executed <\/span><a href = \"https:\/\/github.com\/matlab\/matlab-mcp-server\/blob\/main\/matlab\/matlab_mcp_toolbox\/mcp\/shareMATLABSession.m\"><span class=\"_richTextNode\">shareMATLABSession<\/span><\/a><span class=\"_richTextNode\">, launched the AI agent from the same folder as the MATLAB project and asked:<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\" style=' font-weight: bold; font-style: italic; font-family: monospace;'>See repro.m. It shows unexpected results in Rapid Accelerator for case 4. Explain why and how to fix it. Don't change the model, let me review.<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">To begin, the agent loaded relevant skills from the Simulink Agentic Toolkit:<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_6.png\" width = \"711\" height = \"139\" alt = \"\" style = \"vertical-align: baseline; width: 711px; height: 139px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">The agent ran a few MATLAB commands using the <\/span><span class=\"_richTextNode\" style=' font-family: monospace;'>evaluate_matlab_code<\/span><span class=\"_richTextNode\"> tool, loaded the <\/span><span class=\"_richTextNode\" style=' font-family: monospace;'>matlab-read-documentation<\/span><span class=\"_richTextNode\"> skill to gather more info and quickly responded with:<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_7.png\" width = \"703\" height = \"265\" alt = \"\" style = \"vertical-align: baseline; width: 703px; height: 265px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">To address my request for possible ways to fix the problem, I got this answer:<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_8.png\" width = \"694\" height = \"253\" alt = \"\" style = \"vertical-align: baseline; width: 694px; height: 253px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">I asked the agent to set the configurability of the vehicle mass parameter to Run-time, as suggested in option 2. I then confirmed that the simulation results matched the expected results.<\/span><\/div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class=\"_richTextNode\">Learning opportunity<\/span><\/h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">When I solve a problem using an AI agent, I like to ask how it diagnosed the issue and which tools I could have used to investigate it myself. So I asked:<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\" style=' font-weight: bold; font-style: italic; font-family: monospace;'>Summarize which tools and techniques I could have used to understand and debug that myself manually<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">I also like to ask the agent to generate a Markdown or HTML report of its findings. Here is a screenshot from the HTML report I got:<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_9.png\" width = \"703\" height = \"418\" alt = \"\" style = \"vertical-align: baseline; width: 703px; height: 418px;\"><\/img><\/div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class=\"_richTextNode\">Creating a repeatable tool<\/span><\/h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">While an AI agent can speed up an investigation like this one where I was not sure what to look for and the scope was large, it's not always the most efficient solution. Once a problematic pattern has been identified, it's usually faster to call a function that does the work efficiently in a repeatable manner. To create this function, I asked the AI agent:<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\" style=' font-weight: bold; font-style: italic; font-family: monospace;'>I would like to write a MATLAB function to detect this situation in the future. The function should take the simulationInput object as input and check the existing build_rtp.mat in slprj. The function should return a table with one entry per variable in the simulationInput identified as non-tunable. It should list the variable name, the default and new values, the blockpath of the block(s) where it's used and a reason. For now, include the Simscape configurability reason and keep a placeholder for other future reasons we might discover.<\/span><span class=\"_richTextNode\"> <\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">Within a few seconds, the function was created. Here is what it returns:<\/span><\/div><div style=\"background-color: #F5F5F5; margin: 10px 0 10px 0;\"><div class=\"inlineWrapper outputs\"><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 21px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace, Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; text-indent: 0px; '><span style=\"white-space: pre\"><span >T = findNonTunableOverrides(in(4))<\/span><\/span><\/div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(230, 230, 230) none repeat scroll 0% 0% \/ auto padding-box border-box; font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class=\"inlineElement eoOutputWrapper disableDefaultGestureHandling embeddedOutputsVariableTableElement\" uid=\"87220630\" prevent-scroll=\"true\" data-testid=\"output_2\" style=\"width: calc(100% - 5px);\" tabindex=\"-1\"><div class=\"outputLayer selectedOutputDecorationLayer doNotExport\" aria-hidden=\"true\"><\/div><div class=\"outputLayer scrollableOutputDecorationLayer doNotExport\" aria-hidden=\"true\"><\/div><div class=\"outputLayer navigationFocusLayer doNotExport\" aria-hidden=\"false\" role=\"application\" tabindex=\"-1\"><\/div><div class=\"outputLayer activeOutputDecorationLayer doNotExport\" aria-hidden=\"false\" role=\"application\"><\/div><div class=\"ClientDocument veSpecifier table\" id=\"variableeditor_client_Document_0\" widgetid=\"variableeditor_client_Document_0\" tabindex=\"0\" aria-labelledby=\"variableeditor_views_SummaryBar_0\"><div class=\"summaryBar\" style=\"font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;\"><span>T = <\/span><span style=\"color: rgb(179, 179, 179); font-style: normal;\">2\u00d77 table <\/span><\/div><div id=\"variableeditor_TableViewModel_0\" widgetid=\"variableeditor_TableViewModel_0\" class=\"table lightWeightView ClientViewDiv hasSummaryBar\" data-viewid=\"__1\" style=\"width: 100%; overflow: auto;\"><table cellspacing=\"0\" style=\"border-spacing: 0px; border-collapse: collapse;\"><thead><tr><th rowspan=\"1\" style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border: 1px solid rgb(191, 191, 191); text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span> <\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>VariableName<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>Workspace<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>DefaultValue<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>NewValue<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>ValueChanged<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>BlockPaths<\/span><\/th><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>Reason<\/span><\/th><\/tr><\/thead><tbody><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>1<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"VehicleMass\"<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"global-workspace\"<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>1200<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>1500<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: center;\"><span>true<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"SeriesHybridTransmission\/Vehicle Body\/Vehicle Body\"<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"Non-tunable in build_rtp.mat. Simscape compile-time configurability: SeriesHybridTransmission\/Vehicle Body\/Vehicle Body [mass = VehicleMass; mass_conf = compiletime]\"<\/span><\/td><\/tr><tr><th style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;\"><span>2<\/span><\/th><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"MotorTimeConstant\"<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"global-workspace\"<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>0.2000<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>0.3000<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: center;\"><span>true<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"SeriesHybridTransmission\/Motor\/Motor &amp; Drive\"<\/span><\/td><td style=\"text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; white-space: nowrap; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left;\"><span>\"Non-tunable in build_rtp.mat. Simscape compile-time configurability: SeriesHybridTransmission\/Motor\/Motor &amp; Drive [Tc = MotorTimeConstant; Tc_conf = compiletime]\"<\/span><\/td><\/tr><\/tbody><\/table><\/div><\/div><\/div><\/div><\/div><\/div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class=\"_richTextNode\">Conclusion<\/span><\/h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">Simscape parameters need to have their configurability set to Run-time to be tuned in Rapid Accelerator mode and not trigger a rebuild. We have a full <\/span><a href = \"https:\/\/www.mathworks.com\/help\/simscape\/run-time-parameters.html\"><span class=\"_richTextNode\">documentation section on that topic<\/span><\/a><span class=\"_richTextNode\">.<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_10.png\" width = \"561\" height = \"287\" alt = \"\" style = \"vertical-align: baseline; width: 561px; height: 287px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">The agent was especially useful because the problematic parameter was buried among thousands of others. Investigating manually could have taken considerable time: inspecting parameters, comparing them with simulation results, writing inspection code, and stepping through code in the debugger.<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">While digging further, I confirmed that the <\/span><span class=\"_richTextNode\" style=' font-family: monospace;'>sim<\/span><span class=\"_richTextNode\"> command issues a warning for this behavior. In the original project, however, it was easy to miss.<\/span><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = \"imageNode\" src = \"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_11.png\" width = \"590\" height = \"187\" alt = \"\" style = \"vertical-align: baseline; width: 590px; height: 187px;\"><\/img><\/div><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">Once the agent helped me understand the problem, I asked it to create a simple function to detect similar issues before trying to simulate the model.<\/span><\/div><h2  style = 'margin: 10px 10px 5px 26px; padding: 0px; line-height: 25px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span class=\"_richTextNode\">Now it's your turn<\/span><\/h2><div  style = 'margin: 2px 10px 9px 26px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif, Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span class=\"_richTextNode\">What kinds of problems are you debugging with the help of AI agents? Let us know in the comments below.<\/span><\/div>\r\n<br>\r\n<\/div><script type=\"text\/javascript\">\r\n{ let css = '._richTextNode {white-space: break-spaces;} \/* Copyright 2014-2025 The MathWorks, Inc. *\/\/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsErrorElement .diagnosticMessage-errorType {    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} \/* Copyright 2014-2025 The MathWorks, Inc. *\/\/* Styling that is common to warnings and errors is in diagnosticOutput.css *\/.embeddedOutputsWarningElement {    min-height: 18px;    max-height: 550px;} .embeddedOutputsWarningElement .diagnosticMessage-warningType {    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} \/* Copyright 2015-2025 The MathWorks, Inc. *\/\/* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip *\/.diagnosticMessage-wrapper {    \/* Since this selector may be used outside RTC Container without RTC semantic variables, a    default value is used. An example here is the App Designers alert tooltip. *\/    font-family: var(--rtc-output-font-family, Menlo, Monaco, Consolas, \"Courier New\", monospace);    font-size: var(--rtc-output-font-size, 12px);} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    \/*This fallback value will be used for appdesigner warnings*\/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    \/*This fallback value will be used for appdesigner warnings*\/    color: var(--rtc-warning-output-color, var(--mw-color-matlabWarning));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: var(--mw-color-matlabWarning) !important;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    \/*This fallback value will be used in appdesigner error tooltip text*\/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    \/*This fallback value will be used in appdesigner error tooltip text*\/    color: var(--rtc-error-output-color, var(--mw-color-matlabErrors));    text-decoration: underline;} .rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType,.rtcThemeDefaultOverride .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: var(--mw-color-matlabErrors) !important;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} \/* Copyright 2014-2025 The MathWorks, Inc. *\/.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 550px;} .embeddedOutputsTextElement .textElement,.embeddedOutputsVariableStringElement .textElement {    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 2px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableStringElement { width: initial !important; } \/* Copyright 2017-2025 The MathWorks, Inc. *\/.embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;} \/* ClientDocument has a summary bar child that takes up 17px, this clashes with overflow on the view which allots space for scrollbars. On print preview, this causes headers from <thead> to overlap on subsequent pages. Displaying Document as flex renders summarybar and view in column format and fixes the issue g2788485 *\/.embeddedOutputsVariableTableElement .ClientDocument {  display: flex;  flex-direction: column;}';\r\nlet head = document.head || document.getElementsByTagName('head')[0];\r\nlet style = document.createElement('style');\r\nhead.appendChild(style);\r\nstyle.type = 'text\/css';\r\nif (style.styleSheet) {\r\n    style.styleSheet.cssText = css;\r\n} else {\r\n    style.appendChild(document.createTextNode(css));\r\n}\r\n\r\n\r\n}<\/script>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/DebuggingSimResultsWithAI.m-11-17-26_7.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>I have to admit, in my day-to-day work, I spend a lot more time debugging Simulink models that produce unexpected results than creating new ones. Since I have access to AI coding agents, I have had a... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2026\/11\/17\/debugging-simulation-results-with-an-ai-coding-agent\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":19010,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[700,43,143,33],"tags":[714,707,664,422],"class_list":["post-19014","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-coding-assistant","category-debugging","category-performance","category-simulink-tips","tag-agentic-ai","tag-ai-coding-agent","tag-parameter-tuning","tag-rapid-accelerator"],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/19014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=19014"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/19014\/revisions"}],"predecessor-version":[{"id":19015,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/19014\/revisions\/19015"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media\/19010"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=19014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=19014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=19014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}