how to calculate %?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Minh
el 21 de Sept. de 2022
Comentada: Image Analyst
el 22 de Sept. de 2022
I need to calculate % by dozens of formulas x = (x% 100) / 10 but in MATLAB behind % is a comment?
0 comentarios
Respuesta aceptada
Image Analyst
el 21 de Sept. de 2022
Try this:
x = 23;
str = sprintf('%3.3d', x)
fprintf("hundreds :%s\n", str(1));
fprintf(" tens :%s\n", str(2));
fprintf(" units :%s\n", str(3));
x = 456
str = sprintf('%3.3d', x)
fprintf("hundreds :%s\n", str(1));
fprintf(" tens :%s\n", str(2));
fprintf(" units :%s\n", str(3));
4 comentarios
Image Analyst
el 22 de Sept. de 2022
OK, then please Accept the best answer and "vote" for the other one.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!