output the ohms symbol

조회 수: 94 (최근 30일)
Jose Grimaldo
Jose Grimaldo 2020년 2월 16일
편집: Walter Roberson 2020년 2월 16일
How can i output the ohms symbol using fprintf?
fprintf('The resistance for the given color bands is 26000 ohms')

채택된 답변

Stephen23
Stephen23 2020년 2월 16일
>> 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
Walter Roberson
Walter Roberson 2020년 2월 16일
편집: Walter Roberson 2020년 2월 16일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by