Iterative calculation of control signal by UDF and undefined variable error
조회 수: 1 (최근 30일)
이전 댓글 표시
There are two main problems about my simulation.
The first one is, eventhough I assign values to variables in my user defined function, I get the error below:
"Undefined function or variable 'var_name'. The first assignment to a local variable determines its class."
I solved it by equating the variables which are to be updated to zero and since my updated value is what I need, I have no problems about it. However, it doesn't seem to me that, this is an effective solution for this problem. What would you recommend?
Secondly,I don't think I successfully feed the last value of my variables to generate next values of them. Please, see the block, which is named "pid". Could you please check if the structure I use is right or wrong. If it is wrong, is there another way of performing this task?
Feel free to use the following info to initialize the simulation.
err = [0 0 0]
w1 = rand(1)*ones(1,3)
w2 = rand(1)*ones(1,3)
w3 =rand(1)*ones(1,3)
I = [0 0 0]
ctrl = 0
Thanks in advancce, Best regards.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 PID Controller Tuning에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!