Filter löschen
Filter löschen

how to pick the number in my command window

2 Ansichten (letzte 30 Tage)
mohd
mohd am 26 Apr. 2012
hi there, i need to pick the number from my command window. how to do this. here, i attach the illustration picture for further understanding and more explanation. i hope everyone can understand what i mean.
http://i1259.photobucket.com/albums/ii548/msaiful89/result.png

Akzeptierte Antwort

Wayne King
Wayne King am 26 Apr. 2012
Use find() on the second column of the matrix with the 'first' option, then use that index to return the corresponding value in the first column of the matrix.
X = randi([5 20],10,2);
I = find(X(:,2)>10,1,'first');
X(I,1)
  3 Kommentare
Wayne King
Wayne King am 26 Apr. 2012
I just created some data to illustrate how to do it since I don't have your data and that is easier than me copying off your figure. I just created a 10x2 matrix of random integers between 5 and 20 with that. You don't need that line, you only need the lines:
I = find(X(:,2)>10,1,'first');
X(I,1)
but obviously, you need to use the name of your matrix.
mohd
mohd am 26 Apr. 2012
ok.. thanks a lot sir.. now i'm understand what is it. :-). that mean i need use my matrix. ok. i'm get it.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by