Hello i'm getting this error...can any one help me out?

1 Ansicht (letzte 30 Tage)
Prudhvi Muppalla
Prudhvi Muppalla am 23 Nov. 2014
Kommentiert: Star Strider am 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:

Akzeptierte Antwort

Star Strider
Star Strider am 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 Kommentare
Prudhvi Muppalla
Prudhvi Muppalla am 24 Nov. 2014
Bearbeitet: Prudhvi Muppalla am 24 Nov. 2014
Thank you for your answer star strider.can u please tell me which function can i use instead of randi to make it working.It will be a great help for me.I'm trying to get the OFDM channel estimation. Please see the attached file for the code.
Star Strider
Star Strider am 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);
See the documentation on randi for details.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by