I m trying to create 16x16 matrix with variable terms, but it says Error using ==> vertcat CAT arguments dimensions are not consistent.
Show older comments
A=[1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ps (1-ps-pf) 0 0 0 pf 0 0 0 0 0 0 0 0 0 0
0 ps (1-ps-pf) 0 0 0 pf 0 0 0 0 0 0 0 0 0
0 0 ps (1-ps-pf) 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 (1-ps-pf) 0 0 0 pf 0 0 0 0 0 0 0
ps 0 0 0 0 (1-ps-pf) 0 0 0 pf 0 0 0 0 0 0
0 ps 0 0 0 0 (1-ps-pf) 0 0 0 pf 0 0 0 0 0
0 0 ps 0 0 0 0 (1-ps-pf) 0 0 0 pf 0 0 0 0
0 0 0 0 0 0 0 0 (1-ps-pf) 0 0 0 pf 0 0 0
ps 0 0 0 0 0 0 0 0 (1-ps-pf) 0 0 0 pf 0 0
0 ps 0 0 0 0 0 0 0 0 (1-ps-pf) 0 0 0 pf 0
0 0 ps 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 (1-ps-pf) 0 0
(ps+pf) 0 0 0 0 0 0 0 0 0 0 0 0 0 (1-ps-pf) 0
0 (ps+pf) 0 0 0 0 0 0 0 0 0 0 0 0 0 (1-ps-pf)
0 0 (ps+pf) 0 0 0 0 0 0 0 0 0 0 0 0 0];
3 Comments
matlab
on 19 Feb 2013
Image Analyst
on 19 Feb 2013
Isn't this the same code as before? Like I said below, don't have ps or pf be arrays.
Answers (1)
Image Analyst
on 19 Feb 2013
Edited: Image Analyst
on 19 Feb 2013
0 votes
I assigned some scalar values for ps and pf and it ran fine. You must have at least one of them be an array. What are the values for ps and pf? Put a breakpoint on that line to be sure.
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!