symbollic solving from character string

조회 수: 1 (최근 30일)
David
David 2014년 7월 23일
댓글: David 2014년 7월 23일
Hi everyone, I have a string consisting of e.g. 'y = ca / dy' and wish to solve this symbolically for ca and then calculate ca if I have data for y and dy. I know to do this you would normally type
syms y ca dy
and then use solve. But how can I use syms where y, ca and dy come from a cell array e.g.
inputs = {'y','ca','dy'}
ie something like this i would have thought: syms inputs{1} inputs{2} inputs{3}
Thanks for any help you can provide in this

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 7월 23일
편집: Azzi Abdelmalek 2014년 7월 23일
syms(inputs{1})
%or
syms(inputs{1:2})
%or if you want the entire cell
syms(inputs{:})
  댓글 수: 1
David
David 2014년 7월 23일
Great, thanks for that. it does exactly what I need

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

추가 답변 (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