How to perform the following commands?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
M
el 24 de Mayo de 2022
Respondida: Walter Roberson
el 24 de Mayo de 2022
How to perform the following commands:
result1 = m(:,abs(m(2,:))< threshold ); .......... This line I want to exclude zero value also.(I mean if it zero ignore it and look at the next value)
[~,idx] = min(abs(result1(1,:))); ....... This line I want to exclude zero value also. (I mean if it zero ignore it and look at the next value)
3 comentarios
Walter Roberson
el 24 de Mayo de 2022
create a temporary vector that is abs() and replace 0 values with nan and min() that.
Or loop.
Respuesta aceptada
Walter Roberson
el 24 de Mayo de 2022
temp = abs(result1(1,:));
temp(temp==0) = nan;
[~, idx] = min(temp) ;
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre NaNs en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!