How can i transform a symbolic variable to numbers?

조회 수: 1 (최근 30일)
masoud jiryaei
masoud jiryaei 2019년 9월 4일
댓글: madhan ravi 2019년 9월 4일
I have a matrix in symbolic variable : A=[1 2 3 ; 4 5 6 ;7 8 9]
now I want to transform it to the numerics (a real matrix).

채택된 답변

madhan ravi
madhan ravi 2019년 9월 4일
Use subs() and then use double()
doc subs
doc double
  댓글 수: 2
masoud jiryaei
masoud jiryaei 2019년 9월 4일
How?
Can you show me?
madhan ravi
madhan ravi 2019년 9월 4일
syms x y % an example
A = [x+2, 2+y; 3*x*y, 4*y^2]
v = [2,3]
subs(A,{x,y},{v(1),v(2)}) % here's what happens is that x symbolic variable is substituted with 2 and 3 for y

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by