필터 지우기
필터 지우기

How can I get "P" for each Gas

조회 수: 1 (최근 30일)
Jack
Jack 2013년 9월 24일
>> R = 0.08206; >> T = 300; >> V = 20;
>> Table = {'GasName','GasSymb','a','b';[ 'Helium', 'Hydrogen', 'Oxygen', 'Chlorine','CarbonDioxide']',[ 'He', 'H2', 'O2', 'Cl2','CO2']',[0.0341,0.244,1.36,6.49,3.59]',[0.0237,0.0266,0.0318,0.052,0.0427]'}
Table = 'GasName' 'GasSymb' 'a' 'b' [41x1 char] [12x1 char] [5x1 double] [5x1 double]
>> P = ((R*T)/[V*ones(1,5)]'-Table{:,4})-Table{:,3}./[(V^2)*ones(1,5)]'
??? Error using ==> minus
Too many input arguments.

채택된 답변

dpb
dpb 2013년 9월 24일
... P = ((R*T)/[V*ones(1,5)]'-Table{:,4})-Table{:,3}./[(V^2)*ones(1,5)]'
??? Error using ==> minus
Missing a '.' in the first './' and the content of the arrays in Table are Table{2,4}, etc., ...
>> P = ((R*T)./[V*ones(1,5)]'-Table{2,4})-Table{2,3}./[(V^2)*ones(1,5)]'
P =
1.2071
1.2037
1.1957
1.1627
1.1792
  댓글 수: 1
Jack
Jack 2013년 9월 25일
Thank you so much...

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

추가 답변 (1개)

Youssef  Khmou
Youssef Khmou 2013년 9월 24일
편집: Youssef Khmou 2013년 9월 24일
R = 0.08206;
T = 300;
V = 20*ones(5,1);
Table = {'GasName','GasSymb','a','b';...
[ 'Helium', 'Hydrogen', 'Oxygen', 'Chlorine','CarbonDioxide']',...
[ 'He', 'H2', 'O2', 'Cl2','CO2']',...
[0.0341,0.244,1.36,6.49,3.59]',[0.0237,0.0266,0.0318,0.052,0.0427]'};
n2=Table{2,4};
n1=Table{2,3};
P =((R*T)./V-n2)-n1./V.^2
  댓글 수: 1
Jack
Jack 2013년 9월 25일
Thanks a lot... It works :)

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by