필터 지우기
필터 지우기

How do you create multiple symbolic variables?

조회 수: 15 (최근 30일)
Richárd Tóth
Richárd Tóth 2019년 8월 2일
편집: madhan ravi 2019년 8월 2일
Here is my code, but is there a simpler solution?
% create symbolic variables x1,...,xn
for i=1:n
eval(join(['syms x' string(i)],''));
end

채택된 답변

madhan ravi
madhan ravi 2019년 8월 2일
편집: madhan ravi 2019년 8월 2일
n = 4;
X=sym('x',[1,n]);
syms(X)
If you're using 2019a or later:
n = 4;
syms x [1 n]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by