Error using + Matrix dimensions must agree. Pleasee Helppp
조회 수: 4 (최근 30일)
이전 댓글 표시
if true
% code
endRelRough = [0.00001 0.00005 0.0001 0.0002 0.0004 0.0006 0.0008 0.001 0.002 0.004 0.006 0.008 0.01 0.015 0.02 0.03 0.04 0.05];
ReL = [600:100:3900];
FCL = 64./ReL;
ReT = [[4e3:1e3:9e3] [1e4:1e4:9e4] [1e5:1e5:9e5] [1e6:1e6:9e6] [1e7:1e7:1e8]];
for i=1:length(RelRough)
for j=length(ReT)
FCT_old=1;
residual=1;
while residual>0
FCT_new=1./(-2*log10((RelRough./3.7)+(2.51./(ReT*sqrt(FCT_old))))).^2 ;
residual=abs(FCT_new-FCT_old);
FCT_old=FCT_new
end
FCT(i,j)=FCT_old
end
end
>> FCLT_kimhaote Error using + Matrix dimensions must agree.
Error in FCLT_kimhaote (line 10) FCT_new=1./(-2*log10((RelRough./3.7)+(2.51./(ReT*sqrt(FCT_old))))).^2 ;
댓글 수: 0
답변 (1개)
James Tursa
2017년 11월 14일
The error message is very clear. The variables you are trying to add do not have compatible sizes. Specifically
>> size(RelRough)
ans =
1 18
>> size(ReT)
ans =
1 43
>> FCT_new=1./(-2*log10((RelRough./3.7)+(2.51./(ReT*sqrt(FCT_old))))).^2 ;
??? Error using ==> plus
Matrix dimensions must agree.
You need to fix your code so that the operation is compatible.
댓글 수: 3
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

