two vectors having different sizes
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Najam us Saqib Fraz
el 22 de Oct. de 2020
Respondida: Walter Roberson
el 22 de Oct. de 2020
I have two vectors which have different sizes.I want to perform the operation in away if 1st vector have lesser elements than number of elements in 2nd vector,it should avoid all other extra entries in 2nd vector and perform operations in away that both vector have same same size.This can also happed vice versa i,e 2nd vector have lesser elements.....
0 comentarios
Respuesta aceptada
Walter Roberson
el 22 de Oct. de 2020
L1 = length(A);
L2 = length(B);
L = min(L1, L2);
A(1:L) .* B(1:L)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Mathematics and Optimization 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!