MATLAB: In an assignment A(I) = B, the number of elements in B and I must be the same.

??? in an assignment a(i) = bthe number of elements in b and i must be the same.

Hi ,
I am new to MATLAB, I need help with this problem please help!
I'm trying to do this operation.
A is 256 * 1 double
B is 18 * 1 complex double
I am trying to do
A (17: 240) = B;
But I am getting this error! what might be the reason?
"In assignment A (I) = B, the number of elements in B and I must be the same."

Best Answer

Your:
A(17:240) % is a vector of 224 elements ((240-17+1)x1)
while
B % is a vector of 18 elements (18x1)
that's why you are getting the error