Borrar filtros
Borrar filtros

How to Shorten This Logical Expression?

3 visualizaciones (últimos 30 días)
Rightia Rollmann
Rightia Rollmann el 14 de Ag. de 2016
Respondida: Azzi Abdelmalek el 14 de Ag. de 2016
What is the best way to rewrite A in the shortest way?
B = 1:14;
A = B == 1 | B == 2 | B == 3 | B == 7 ;

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 14 de Ag. de 2016
A = ismember(B,[1 2 3 7])

Más respuestas (1)

Image Analyst
Image Analyst el 14 de Ag. de 2016
How about
A = B <= 3 | B == 7 ;

Categorías

Más información sobre Graph and Network Algorithms 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