Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: I have a set of data (nxm), how to write a matlab code so that I can select Date: Sun, 28 Apr 2013 14:49:08 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 26 Message-ID: <kljct4$6pv$1@newscl01ah.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: www-06-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1367160548 6975 172.30.248.38 (28 Apr 2013 14:49:08 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Sun, 28 Apr 2013 14:49:08 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 4202208 Xref: news.mathworks.com comp.soft-sys.matlab:794485 The data is 5x5. Consist of diameter and F. When diameter is 3, F is 80, and so on. d F 3 80 5 100 7 120 9 140 11 160 This is basically an iteration process. The first value of d and F is chosen by the user. The first value of d that I want to select is 7, and the corresponding F is 120. I want to write a program, so that d is equal to the value of d that I select. This is my code. load data.dat; d=data(:,1); F=data(:,2); X=find(d,3) Y=find(F,3) I don't really know how to write the code, so I just give it a try. The X=find(d,3), because 7, and 120 are in the 3rd row. But of course the code cannot work. I hope you do really understand what I'm trying to say. Thank you