Index exceeds the number of array elements (111)(this is error)

hello everyone,
I have two queries.
  1. I want to calculate the average of all maxvalue
  2. i want to find the time of occuarances of each value. this output (res_signal_example.plot1_x_time) contains the time value.
I am working with output value to calculate the transmission delay of getting each peak value.
this are my code.
res_signal_example = EXAMPLE_runner_00_SingleBurst_S2S( )
% particle tracking based (SLOW)
%value = max (res_signal_example.nRx_raw_matrix_wout_noise, [], [1 2])
for k=1:size(res_signal_example.nRx_raw_matrix_wout_noise,3)
a=res_signal_example.nRx_raw_matrix_wout_noise(:,:,k);
[maxv,idx]=max(a(:));
[ii,jj]=ind2sub([size(res_signal_example.nRx_raw_matrix_wout_noise,1) size(res_signal_example.nRx_raw_matrix_wout_noise,2)],idx);
value{k}=[maxv ii jj]
end
celldisp(value);
Following image is the total output of my simulation. I am working with MUCIN simulator. plot1_x_time(1*1000) is the time of occurances of each peak value. I have 111 peak values (1*111). i need to find the time of values in plot1_x_time. I need 111 time value for each peak values.

5 Comments

You're complicating your life by working on nRx_raw_matrix_wout_noise as if it was 3D when it is actually 2D (dimension 1 is singleton).
With regards to your question, it's really not clear how your plot1_x_time, a vector with 1000 elements relates with a matrix of size 2000x111. None of the sizes match, If plot1_x_time had 2000 elements, your question would make sense. As it is, you need to explain how the two are related.
Thank you for your reply.
Ans 1. nRx_raw_matrix_wout_noise value give me array value 1*2000*111, i am working on molecular communication, so i am sending 2000 random values(as molecules) to receiver, and replicate this same works 111 times. so each time i am getting a max number of molecules reached at the receiver end. What ever i have to do with this array is to every replication (1 to 111) each has a peak number and i need to collect them with index value.
Ans 2. plot1_x_time(1*1000) is the time for each single replication. (1 to 111) so, each peak value has each time of occuring. i want to calculate that also, that will give me the propagation delay of each time for 2000 Random values(molecules).
if you have time, please go through my code, i attached here. you dont need to go throug the modulation and demodulation. All i need is to calculate propagation delay of max random number.
I go through the B = squeeze(res_signal_example.nRx_raw_matrix_wout_noise) line, and fine a 2000*111 matrix, each column has a peak value. and need to calculate the time of each peak value.
Yes, I understood more or less what your data represent. The problem is that you have 2000 values but only 1000 times, so it's not clear how you find the timing of a value.
Thank you, By using your hints, I consider it as a 2D. and find the time, and i am trying to plot the time value in histogram.
Again I asked a questions,

Sign in to comment.

Answers (0)

Asked:

on 28 Jan 2019

Edited:

on 29 Jan 2019

Community Treasure Hunt

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

Start Hunting!