Indexing the output of the function nsumk

1 visualización (últimos 30 días)
Michael Vaughan
Michael Vaughan el 19 de Sept. de 2020
Respondida: Walter Roberson el 19 de Sept. de 2020
Hey guys, I'm really new to programming. I just figured out how to add a path and get the program nsumk working.
When I type this in:
[~,x] = nsumk(5,5);
result=flipud(unique(sort(x,2,'descend'),'rows'))
This is the output:
result =
5 0 0 0 0
4 1 0 0 0
3 2 0 0 0
3 1 1 0 0
2 2 1 0 0
2 1 1 1 0
1 1 1 1 1
How to I index the entries of this matrix to call upon later? Like, how to I declare an entry in a specific row/column, say in location (3,2), that is, third row and second column, in this case 2, into a variable?
Also, how do I save a specific row to call upon later?
Thanks for your patience with my nooby questions.

Respuestas (1)

Walter Roberson
Walter Roberson el 19 de Sept. de 2020
result32 = result(3,2)
row3 = result(3,:)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by