output the ohms symbol

251 views (last 30 days)
Jose Grimaldo
Jose Grimaldo on 16 Feb 2020
Edited: Walter Roberson on 16 Feb 2020
How can i output the ohms symbol using fprintf?
fprintf('The resistance for the given color bands is 26000 ohms')

Accepted Answer

Stephen23
Stephen23 on 16 Feb 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 Comment
Walter Roberson
Walter Roberson on 16 Feb 2020
Edited: Walter Roberson on 16 Feb 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.

Sign in to comment.

More Answers (0)

Categories

Find more on Tables in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!