output the ohms symbol

261 visualizaciones (últimos 30 días)
Jose Grimaldo
Jose Grimaldo el 16 de Feb. de 2020
Editada: Walter Roberson el 16 de Feb. de 2020
How can i output the ohms symbol using fprintf?
fprintf('The resistance for the given color bands is 26000 ohms')

Respuesta aceptada

Stephen23
Stephen23 el 16 de Feb. de 2020
>> fprintf('The resistance for the given color bands is 26000 Ω\n')
The resistance for the given color bands is 26000 Ω
>> fprintf('The resistance for the given color bands is 26000 \x2126\n') % hex
The resistance for the given color bands is 26000 Ω
>> fprintf('The resistance for the given color bands is 26000 \20446\n') % octal
The resistance for the given color bands is 26000 Ω
  1 comentario
Walter Roberson
Walter Roberson el 16 de Feb. de 2020
Editada: Walter Roberson el 16 de Feb. de 2020
fprintf('The resistance for the given color bands is 26000 %c\n', char(937));
937 (0x3A9) and 8486 (0x2126) have the same decomposition; as far as Unicode cares, they are both the same greek letter. It would, however, be permissible for the two to have different glyphs, I think
The symbols that Stephen used reached my browser as 937 characters.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Tables 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