Error using sub2ind - Out of range subscript.

조회 수: 5 (최근 30일)
Vuong Hoang
Vuong Hoang 2018년 4월 29일
댓글: Star Strider 2018년 4월 29일
I want to simplify the equation mcphayphayvtzto that contains the symbolic variable tz.
disp('The combustion process')
disp('The mean molar specific heat of combustion products')
M2(1,1)= 0.4958;
MCO2(1,1)= 0.0512;
MCO(1,1)=0.0201;
MH20(1,1)=0.0625;
MH2(1,1)=0.0100;
MN2(1,1)=0.3520;
M2(1,3201)=0.5367;
MCO2(1,3201)=0.0655;
MCO(1,3201)=0.0057;
MH20(1,3201)=0.0696;
MH2(1,3201)=0.0029;
MN2(1,3201)=0.3930;
disp('Dua vào Formulae to determine mean molar heat capacities of certain gases at constant volume, kJ/(kmole deg), at tz (do C)')
disp('mcphayphayvtzto=(1/M2)*[MCO2*(39.123+0.003349*tz)+MCO*(22.490+0.001430*tz)+MH20*(26.670+0.004438*tz)+MH2*(19.678+0.001758*tz)+MN2*(21.951+0.001457*tz)]')
syms tz
disp('At n = 800 rpm')
mcphayphayvtzto(1,1)=(1/M2(1,1))*[MCO2(1,1)*(39.123+0.003349*tz(1,1))+MCO(1,1)*(22.490+0.001430*tz(1,1))+MH20(1,1)*(26.670+0.004438*tz(1,1))+MH2(1,1)*(19.678+0.001758*tz(1,1))+MN2(1,1)*(21.951+0.001457*tz(1,1))];
pretty(mcphayphayvtzto(1,1))
disp('At n = 4000, 6000, 7000 rpm')
mcphayphayvtzto(1,3201)=(1/M2(1,3201))*[MCO2(1,3201)*(39.123+0.003349*tz(1,3201))+MCO(1,3201)*(22.490+0.001430*tz(1,3201))+MH20(1,3201)*(26.670+0.004438*tz(1,3201))+MH2(1,3201)*(19.678+0.001758*tz(1,3201))+MN2(1,3201)*(21.951+0.001457*tz(1,3201))];
pretty(mcphayphayvtzto(1,3201))
  댓글 수: 3
Vuong Hoang
Vuong Hoang 2018년 4월 29일
편집: Vuong Hoang 2018년 4월 29일
thanks, i created new syms variable called tz3201.
Star Strider
Star Strider 2018년 4월 29일
My pleasure.

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

답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by