Constant variable

5 visualizaciones (últimos 30 días)
justin
justin el 19 de Mzo. de 2012
As for my second question, is there a command I can state where the matrix info(10000x3) can be display the info(:,1) when info(:,2)<100 & ~=0 and when info(:,3) increases by 20 at the same time? Thanks for any help

Respuestas (1)

Geoff
Geoff el 19 de Mzo. de 2012
You can combine this all into a long command line, but let's split it up for clarity:
col2select = info(:,2) < 100 & info(:,2) ~= 0;
col3select = [0; diff(info(:,3))] == 20;
result = info(col2select & col3select, 1);
I assumed that you wanted only an exact increase in 20 from the previous line in column 3. It's easy to modify this to your needs.
This will output only the relevant rows. You can of course find the indices of those rows if you need:
indices = find(col2select & col3select);
-g-

Categorías

Más información sobre Dynamic System Models 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