How can I solve a problem with subs?

조회 수: 1 (최근 30일)
Carlos
Carlos 2012년 11월 21일
I have to substitute values in a matrix with 20 variables. I substitute variable after variable using a for loop, but in some cases the matrix does not contain the variable the loop is substituting, and in these cases the problem is Matlab replaces the zeros in the matrix wiht the variable. For instance if I am trying to replace the symbolic variable u3 subs(mat,{u3},{0}) and the matrix does not contain u3,the result is that u3 will appear in the matrix positions which were originally 0.(If originally mat(10,10)=0, after substitution mat(10,10)=u3).

채택된 답변

Walter Roberson
Walter Roberson 2012년 11월 21일
  댓글 수: 1
Carlos
Carlos 2012년 11월 22일
Thank you very much Walter, you have saved my life.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by