Index exceeds the number of array elements
3 次查看(过去 30 天)
显示 更早的评论
When trying to recreate an image using the Receive Code attached, i get this error
Index exceeds the number of array elements. Index must not exceed
30368.
Error in Receive (line 4)
testarray = testarray(36:sentsize(1)+35);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
how should i fix it? The whole purpose of my simulink project is to send a jpg file, transform it into bits, transmit the bits through the OFDM based system, receive it and reconstruct the image. All the related code and simulink file is uploaded.
1 个评论
Walter Roberson
2025-5-8
Function set_OFDM_parameters calls a function named png but no function named png exists. Instead, there is a function named PNG .
Function run_before_OFDM_80211a_sim calls function dec2bin1() which does not exist.
回答(1 个)
Matt J
2025-5-8
编辑:Matt J
2025-5-8
Either testarray is shorter than you planned or sentsize(1) is larger than you planned. Specifically sentsize(1)+35 is exceeding the length of testarray.
2 个评论
Matt J
2025-5-8
Did you step through the code with the debugger? That's the usual way to trace a point in the code where something unexpected happens.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 RF Blockset Models for Transceivers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!