Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
one scalar from two vectore
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have two vectors. one speed (v1 v2 v3) and one that identifies the car on (a1 a2 a3). Only one car is running. which block I have to use to get the single speed? the bits of two cars are zero and the bits of a car is 1.
0 comentarios
Respuestas (2)
dpb
el 22 de En. de 2015
If a is a numeric array of bits,
V=v(logical(a));
Alternatively, keep a as logical array to avoid the cast or if it must be numerical it's also
V=v(find(a));
but logical will be faster than find I'd expect.
1 comentario
La pregunta está cerrada.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!