Matlab >>Dimensions of matrices being concatenated are not consistent
Date: 2022-12-22 12:23:59
I have angle information:
for i=1:10 angles = func1(val); polar([angles 0]*pi/180,[15 0],'r'); end
angles is 512x1 matrix but matlab give error on polar() function,like
Error using horzcat Dimensions of matrices being concatenated are not consistent.
How to solve this problem? pls help me guys
Answers:
If angles
is a column vector as you say (512x1), you can't concatenate a 0
to the right. You should concatenate below: replace [angles 0]
by [angles; 0]
.
Another possible mistake is that the two vector arguments of polar
should have the same size, and in your case they don't.