Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

selection of specific value of a column from a matrix

1 visualización (últimos 30 días)
raqib Iqbal
raqib Iqbal el 4 de Jul. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
cellular=1:6
resource=[1 6;2 12;3 7;4 3;5 17]
what are the syntaxes are to use if i want cellular value select row with min column2 value 5 and more??????
output like
1 1 6
2 3 7
3 2 12
and so on...................

Respuestas (1)

madhan ravi
madhan ravi el 4 de Jul. de 2020
Use the same code I gave you in previous code , but remove 'descend' .
  5 comentarios
raqib Iqbal
raqib Iqbal el 4 de Jul. de 2020
clear all;
device = [10:1:20];
block = [1 16;2 18; 3 17; 4 21; 5 23];
block_sort = sortrows(block,-2);
ROM (:,1) = device;
for i =1:length(device)
if i<=size(block,1)
ROM (i,2:3) = block_sort(i,:)
else
[j,_] = find(block_sort>=device(i)+3)
ROM (i,2:3) = block_sort(max(j),:)
endif
endfor
####sir what i want is this ocatave code output,,,and i want to do it in matlab please run it to see the output..
madhan ravi
madhan ravi el 5 de Jul. de 2020
ROM = [cellular(1:size(resource,1)).', sortrows(resource, 2)];
ROM = ROM(ROM(:, end) > 5, :)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by