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!