From: "Marios Karaoulis" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: vectorize this
Date: Wed, 7 Mar 2012 00:02:24 +0000 (UTC)
Organization: Colorado School of Mines
Lines: 12
Message-ID: <jj68ig$l1u$>
References: <> <jj60p4$pon$>
Reply-To: "Marios Karaoulis" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1331078544 21566 (7 Mar 2012 00:02:24 GMT)
NNTP-Posting-Date: Wed, 7 Mar 2012 00:02:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 574495
Xref: comp.soft-sys.matlab:760131

>   You are using A, B, M, and N as row indices in Jx, Jy, and Jz which each have only 225 rows.  Yet 'randi' can generate integers as high as 1890 (= 'num_mes') for these four variables.  How do you avoid getting an error message about that (not to mention possibly meaningless results?)
> Roger Stafford

None of the data I have are random. I just created some random matrices for you to understand the problem. 
You are right thuoght, ind_data should be like this

ind_data = randi([1:num_param],num_mess,4);

Sorry about that.