Index exceeds the number of array elements

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

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
Matt J 2025년 5월 8일
편집: Matt J 2025년 5월 8일

0 개 추천

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

Nisab
Nisab 2025년 5월 8일
Do you have any recommendations in how to solve it? specific to my simulink workspace problem?
Matt J
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2024b

질문:

2025년 5월 8일

댓글:

2025년 5월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by