how to apply threshold in this 8x8 numeric matrix?

16 visualizaciones (últimos 30 días)
Arcane
Arcane el 4 de Mayo de 2021
Comentada: Arcane el 4 de Mayo de 2021
3 148 117 148 145 178 132 174
2 176 174 110 185 155 118 165
0 100 124 113 193 136 146 108
0 155 170 106 158 130 178 170
9 196 138 113 108 127 144 139
6 188 143 183 137 162 105 169
9 122 156 119 188 179 100 151
8 176 137 114 135 123 134 183

Respuesta aceptada

KSSV
KSSV el 4 de Mayo de 2021
A = [3 148 117 148 145 178 132 174
2 176 174 110 185 155 118 165
0 100 124 113 193 136 146 108
0 155 170 106 158 130 178 170
9 196 138 113 108 127 144 139
6 188 143 183 137 162 105 169
9 122 156 119 188 179 100 151
8 176 137 114 135 123 134 183] ;
threshold = 100 ;
idx = A<threshold ;
A(idx) = 0 ;
  3 comentarios
KSSV
KSSV el 4 de Mayo de 2021
idx is a logical matrix, no need to use semicolon.
Arcane
Arcane el 4 de Mayo de 2021
Thanks man

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical 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