How to display pi symbol in the output?
古いコメントを表示
how to display pi symbol instead of numerical value in the out of the given code
clc; clear all; close all;
nA=3.3;nB=2.25;
% nB=3.3;nA=2.25;
S=sign(1-(nA^2/nB^2));
x=-1i*log(S);
if x>0
disp('Zak Phase of 0th band = ')
disp(pi)
else
disp('Zak Phase of 0th band = ')
disp('0')
end
1 件のコメント
sprintf('\x3c0')
double('π')
採用された回答
その他の回答 (2 件)
Nathan Hardenberg
2023 年 8 月 24 日
編集済み: Nathan Hardenberg
2023 年 8 月 24 日
You can display pi as a sybolic
disp(sym(pi))
Or you can use a π-character (𝜋 or π).
disp("𝜋")
disp("π")
How about this?
S = sprintf('Zak Phase of 0th band = %c',960);
disp(S);
1 件のコメント
Hiro Yoshino
2023 年 8 月 24 日
Please refer to the list of Unicode for your help:List of Unicode characters
カテゴリ
ヘルプ センター および File Exchange で Assumptions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!