mismatch between mux input and the vector length when using Matlab Interpreted function with persistent variables
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I am using the interpreted function MPC3DOF(u) to compute the control force. The input u is a mux vector with 23 elements as shown in the function. Uout is the output vector of the function with 12 elements. The 3rd and 4th elements of Uout are feedback to the first and second input of u with memory block.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1000390/image.jpeg)
When I run the simulation, the error message comes out :![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1000395/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1000395/image.jpeg)
The number of element length appears in the simulink as well. I don't understand why the input port 3 of Mux is a vector with 2 elements.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1000400/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1000400/image.jpeg)
This is how I call the input u from the intepreted function
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1000405/image.jpeg)
I also tried MPC3DOF(u(1:2),u(3:8),u(9:20),u(21:22),u(23)). But same error message appears.
When I test the interpreted function alone, like input a time series with the data of 23 elements each time step, it works fine. But when I put it into the model, the error message appers.
Could anyone please offer some advice on this issue? Thank you in advance.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!