From: Vinh Le on
Me again^_^
I read this thread - http://www.mathworks.com/matlabcentral/newsreader/view_thread/276255, however, cannot make it work so have to ask.

I would like to select all elements of a row in a matrix using simple matlab function. Here is how I would like to have:

matrixA = [0 1 2; 3 4 5; 6 7 8]
N = 2
rowN = select(matrix, N)
rowN = [3, 4 ,5]
==============
I can to write lengthy code +_+ using element selection
RowN(index) = matrix(N,i) using For loop but I believe there might be a better way
From: Nathan on
On Mar 19, 4:45 pm, "Vinh Le" <lekhanhv...(a)gmail.com> wrote:
> Me again^_^
> I read this thread -http://www.mathworks.com/matlabcentral/newsreader/view_thread/276255, however, cannot make it work so have to ask.
>
> I would like to select all elements of a row in a matrix using simple matlab function.  Here is how I would like to have:
>
> matrixA = [0 1 2; 3 4 5; 6 7 8]
> N = 2
> rowN = select(matrix, N)
> rowN = [3, 4 ,5]
> ==============
> I can to write lengthy code +_+ using element selection
> RowN(index) = matrix(N,i) using For loop but I believe there might be a better way

....
So, are you using a cell array or a matrix? (Your example here is a
matrix)
%data
matrixA = [0 1 2;3 4 5;6 7 8]
N=2
%engine
rowN = matrixA(N,:);

%%%%%%%%%%%%%%%
rowN =
3 4 5

This is the same response as shown in the link you provided,
however...

What is it that you really want?

-Nathan
From: Vinh Le on
I got this one - thank you very much for your assistance
 | 
Pages: 1
Prev: color segmentation
Next: image processing