Hello i'm getting this error...can any one help me out?
1 view (last 30 days)
Show older comments
Prudhvi Muppalla
on 23 Nov 2014
Commented: Star Strider
on 24 Nov 2014
Error using reshape; Size arguments must be real integers.
Error in Channel_behaviour (line 7); xsym = bin2dec(reshape(x,k,length(x)/k).','left-msb');% Convert the bits in x into k-bit symbols.
This is my code:
0 Comments
Accepted Answer
Star Strider
on 23 Nov 2014
There is actually nothing to reshape anyway. Two of the reshape arguments are scalars (specifically ‘n’=256 and ‘k’=4, and since length(x)=1, the last size argument is going to be length(x)/k=1/4 which is not an acceptable size for a matrix or array.
I’m not really certain what you’re doing, but you might want to revise the documentation on randi. I believe you were expecting ‘x’ to be a vector.
2 Comments
Star Strider
on 24 Nov 2014
The randi function will work, and do exactly what you want it to do. You just have to tell it. If you want a vector of 20 digits from 0-9, ‘x’ becomes:
x = randi([0 9],1,20);
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots 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!