Error using horzcat - CAT arguments dimensions are not consistent.

2 ビュー (過去 30 日間)
biji buji
biji buji 2013 年 10 月 13 日
コメント済み: Walter Roberson 2013 年 10 月 14 日
I have this array:
P = [ 0.0100 0.0078 0.0022 0 0.0140
0 0.6651 0.2249 0.0950 0.0150
0 0 1.1281 -0.1431 0.0150
0 0 0 0.9840 0.0160]
and getting this error on :
Pr = [zeros(5,1) cumsum(P,2)]

回答 (1 件)

sixwwwwww
sixwwwwww 2013 年 10 月 13 日
Dear Biji, here you have dimension of "cumsum(P, 2)" 4x5 while "zeros(5, 1)" has dimension of 5x1 so you can see dimensions of both matrices don't match so you can't merge them like this: you can modify a bit as follows:
Pr = [zeros(4, 5) cumsum(P, 2)];

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by