Error using / Matrix dimensions must agree.

조회 수: 16 (최근 30일)
Jorge
Jorge 2014년 9월 13일
답변: Bharati Nelligani 2015년 9월 3일
P= 220;
n= 2;
V= linspace(0.1,10,21);
a= 5.536;
b= 0.03049;
R= 0.08314472;
T_i= ((P*V)/(n*R));
T_vw= P+((n.^2).*a)/(V.^2).*((V-n.*b)./(n.*R));
Results = [P', T_i', T_vw'];
char(' P Ti Tvw',...
num2str ([P,T_i,T_vw], '%12.4f'))
Command window display
>> Firstmatlab1b
Error using /
Matrix dimensions must agree.
Error in Firstmatlab1b (line 10)
T_vw= P+((n.^2).*a)/(V.^2).*((V-n.*b)./(n.*R));

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 9월 13일
You should replace / by ./
  댓글 수: 2
Jorge
Jorge 2014년 9월 13일
after i replaced it by ./ i got this
Error using horzcat Dimensions of matrices being concatenated are not consistent.
Error in Firstmatlab1b (line 12) Results = [P', T_i', T_vw'];
Azzi Abdelmalek
Azzi Abdelmalek 2014년 9월 13일
편집: Azzi Abdelmalek 2014년 9월 13일
Why you don't try to fix the problem? the error message says there is a problem with your concatenation.

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


Bharati Nelligani
Bharati Nelligani 2015년 9월 3일
As there is a program for repmap in matlab release notes when i tried to execute i am getting an error that Error using + Matrix dimensions must agree. so please tell me what to do and help me with this.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by