How to retrieve last 3 digits from each entry of a matrix of order 3 x 4 ?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Abdul Gaffar
el 16 de Nov. de 2019
Respondida: Star Strider
el 16 de Nov. de 2019
Let A = [35679, 35678, 35677, 35676; 35675, 35674, 35673, 35672; 35671, 35670, 35669, 35668];
how can I extract last 3 digits from each entry of the matrix 'A' ?
0 comentarios
Respuesta aceptada
JESUS DAVID ARIZA ROYETH
el 16 de Nov. de 2019
solution:
A = [35679, 35678, 35677, 35676; 35675, 35674, 35673, 35672; 35671, 35670, 35669, 35668];
last3digits=A-round(A,-3);
last3digits(last3digits<0)=last3digits(last3digits<0)+1000;
disp(last3digits)
0 comentarios
Más respuestas (1)
Star Strider
el 16 de Nov. de 2019
Another approach:
A = [35679, 35678, 35677, 35676; 35675, 35674, 35673, 35672; 35671, 35670, 35669, 35668];
Out = 1000*rem(A/1000,1)
producing:
Out =
679 678 677 676
675 674 673 672
671 670 669 668
0 comentarios
Ver también
Categorías
Más información sobre State-Space Control Design and Estimation 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!