error at symbol ofdm "Index exceeds matrix dimensions."
Show older comments
i get this error "Index exceeds matrix dimensions."
Error in Untitled (line 293)
fx = [guard1 data(1:12) pilots(1) data(13:36) pilots(2)...
data(37:60) pilots(3) data(61:84) pilots(4) data(85:96) DC...
data(97:108) pilots(5) data(109:132) pilots(6) data(133:156)...
pilots(7) data(157:180) pilots(8) data(181:192) guard2];
because i have list program for make a pilot and guard ofdm symbol. and then i got that problem. so how do i solve this error?
please help me.. i don't know what i do for solve that error. i finish browse at google and mathwork's help but i can't solve that problem.
can somebody help me and give advise for me? thank you..
thank you.
Accepted Answer
More Answers (1)
mawaranninditya
on 31 Jul 2013
0 votes
3 Comments
Walter Roberson
on 31 Jul 2013
Before the assignment to fx, add this:
if numel(pilots) < 8 || numel(data) < 192
error(sprintf('pilots needs to be at least 8 long but is %d; data needs to be at least 192 long but is %d', numel(pilots), numel(data));
end
Once that is in place, then instead of crashing with the error message about exceeding matrix dimension, you will get a controlled error message telling you what the problem was. The statement will not in itself solve the problem, but it will give you information about what you should be looking for in the code above that.
mawaranninditya
on 1 Aug 2013
Walter Roberson
on 1 Aug 2013
As I wrote, the statement will not solve the problem, but it will give you information about what you should be looking for. What does it print out as the length for pilots and for data ?
Categories
Find more on WLAN Toolbox 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!