Help use unassigned variables in matlab
조회 수: 17 (최근 30일)
이전 댓글 표시
Below is a question that I have for control theory in which I am being asked to find a feedback gain K to generate a specific set of eigenvalues.
I have written the code that I would typically use to solve this kind of question if all the values were given but this question is asking me to solve
for the K values for an unspecified frequency. I'm not asking to have the problem solved for me, I am simply wondering if there is a way to create a variable (wo)
and use it within my script without assigning a specific value.
I apologize for lacking the vocabulary to ask the question succinctly, that is why I provided the problem for context.
Thank you for your time and help.
채택된 답변
Shiva Kalyan Diwakaruni
2021년 5월 10일
Hi,
The reason of the error is that the input arguments to "place" are not "convertible to floating-point numbers" as "A" and "B" contains symbolic variables. To avoid the error, one could wrap the call to "place" in another symbolic function such that "A" and "B" is conceivably reduced to a floating number. Here is the code that does that:
symplace = @(A,B,P)feval(symengine,'min',A,B,P);
LambdaCC = symfun(symplace(A,B,P));
Hope it helps.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!