"Expected u to be a scalar" Error
3 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/473097/image.jpeg)
So, i tried to run this Simulink code, then i got this error:
MATLAB System block 'arduino_project/LED Red' error occurred when invoking 'validateInputsImpl' method of 'codertarget.arduinobase.blocks.DigitalWrite'. The error was thrown from ' 'C:\ProgramData\MATLAB\SupportPackages\R2020b\toolbox\target\supportpackages\arduinobase\+codertarget\+arduinobase\+blocks\DigitalWrite.p' at line 0 'E:\Apps\MatLab2020b\toolbox\shared\spcuilib\slscopes\+Simulink\+scopes\+source\@WiredSource\sendSimulationCommand.m' at line 13 'E:\Apps\MatLab2020b\toolbox\shared\spcuilib\unifiedscopes\@uiservices\fevalNoBacktrace.m' at line 10 'E:\Apps\MatLab2020b\toolbox\shared\spcuilib\slscopes\+Simulink\+scopes\+source\@WiredSource\sendSimulationCommand.m' at line 13 'E:\Apps\MatLab2020b\toolbox\shared\spcuilib\slscopes\+Simulink\+scopes\+source\@PlaybackControls\slPlayPause.p' at line 0 'E:\Apps\MatLab2020b\toolbox\shared\spcuilib\slscopes\+Simulink\+scopes\+source\@PlaybackControls\PlaybackControls.p' at line 0'.
Caused by:
- Expected u to be a scalar.
Anyone know what should i do?
3 个评论
Walter Roberson
2023-8-10
编辑:Walter Roberson
2023-8-10
I just noticed that the thermal sensor is compared to a value, and combined on a bus with a boolean, producing a bus with two booleans, and that bus is being sent to arduino digital output. But arduino digital output is expecting a scalar not a bus.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modeling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!