Error using vertcat - dimensions of matrices being concatenated are not consistent
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I keep getting this error, Error using vertcat - dimensions of matrices being concatenated are not consistent This is my code
W = [ones(1,56);1.41*ones(1,37);0.71*ones(1,16)];
0 Kommentare
Antworten (2)
Roger Stafford
am 12 Nov. 2017
In W you are asking that it have three rows, the first one with 56 elements, the second with only 37, and the third with 16. That is contrary to the requirement that all rows in a matrix have the same number of elements.
0 Kommentare
Waseem Hussain
am 12 Nov. 2017
1 Kommentar
Roger Stafford
am 12 Nov. 2017
Change to:
W = [ones(1,56),1.41*ones(1,37),0.71*ones(1,16)];
That is, change the two semicolons to commas.
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!