필터 지우기
필터 지우기

Change the class from double to sym of a cell array

조회 수: 5 (최근 30일)
RoboKid
RoboKid 2013년 11월 10일
댓글: RoboKid 2013년 11월 11일
Is there anyway to get D as [ s + 3 ; s + 2] in the following program.
i.e. I want to change the class of D from double to sym
syms s
D = {[1 3] ; [1 2]}
%N= {[1];[1] }
%G=tf(N,D)

답변 (1개)

Walter Roberson
Walter Roberson 2013년 11월 10일
cellfun(@tf, N, D)
  댓글 수: 3
Walter Roberson
Walter Roberson 2013년 11월 10일
Is the purpose not to go through matching elements of N and D and putting the corresponding elements through tf() to get the symbolic transfer function relevant for that pair of matching elements? If so then the code I gave should do that. You can overwrite D with the result if you want to.
If you are trying to convert D = {[1 3] ; [1 2]} to [s + 3 ; s + 3] without using tf(), then I would have to ask why two different arrays, [1 3] and [1 2] are both to be converted to s + 3 ?
RoboKid
RoboKid 2013년 11월 11일
I'm sorry .. I typed wrong s+3 instead s+1, I just wanted to change the class of D from 'cell' to sys.. and it's work with cellfun. thanks.

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

카테고리

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