Dimension error in matrix manipulation
이전 댓글 표시
Hi!!
I have a B matrix made of variables. It supposed to give me just one value per row (23 rows), but instead is giving me 230 rows, and off course it is not matching the dimensions of my A matrix. I cannot find the error in the script. Here is my Bmatrix:
%Define B Matrix BMAT=[-qsunN-hout*Tamb-hskyN*Tsky-(Pbrick*Cpbrick*(Lbriw/2)*(1/deltat));%B1
-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pbrick*Cpbrick*(Linsw/2)*(1/deltat));%B2
-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B3
-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B4
-qsunS-hout*Tamb-hskyS*Tsky-(Pbrick*Cpbrick*(Lbriw/2)*(1/deltat));%B5
-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pbrick*Cpbrick*(Linsw/2)*(1/deltat));%B6
-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B7
-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B8
-qsunE-hout*Tamb-hskyE*Tsky-(Pbrick*Cpbrick*(Lbriw/2)*(1/deltat));%B9
-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pbrick*Cpbrick*(Linsw/2)*(1/deltat));%B10
-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B11
-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B12
-qsunW-hout*Tamb-hskyW*Tsky-(Pbrick*Cpbrick*(Lbriw/2)*(1/deltat));%B13
-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pbrick*Cpbrick*(Linsw/2)*(1/deltat));%B14
-(Pins*Cpins*(Linsw/2)*(1/deltat))-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B15
-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B16
-qsunE-hout*Tamb-hskyE*Tsky-(Pglas*Cpglas*Lglas*(1/deltat));%B17
-qsunS-hout*Tamb-hskyS*Tsky-(Pglas*Cpglas*Lglas*(1/deltat));%B18
-qsunW-hout*Tamb-hskyW*Tsky-(Pglas*Cpglas*Lglas*(1/deltat));%B19
-qsunR-hout*Tamb-hsky*Tsky-(Pcon*Cpcon*(Lcon/2)*(1/deltat));%B20
-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat))-(Pcon*Cpcon*(Lcon/2)*(1/deltat));%B21
-(Pgyps*Cpgyps*(Lgypw/2)*(1/deltat));%B22
-qsunE-qsunS-qsunW-qach-qin]%B23
fprintf('BMAT')
DATA=xlswrite('Data 3',BMAT)
Thanks!
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!