Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Subscripted assignment dimension mismatch.

Hey guys,

I'm pretty new to Matlab so please bear with me :)

I wrote the following code

============================================================================

Result2 = zeros(1, 324012);

for i = 1:324012

if (Result1(1, i) < 0)

Result2(1, i) = dec2bin(typecast(int16(Result1(1,i)),'uint16'));

else

Result2(1, i) = dec2bin(Result1(1,i));

end

end

============================================================================

And I get the following error

============================================================================

??? Subscripted assignment dimension mismatch.

Error in ==> Untitled4 at 11
Result2(1, i) = dec2bin(Result1(1,i));

============================================================================

What am I doing wrong?

Thanks a lot.

Assaf.
Sign In or Register to comment.