Sign minus, not hyphen

50 views (last 30 days)
Federico
Federico on 15 Jun 2022
Edited: Chunru on 15 Jun 2022
Hello,
I must replace the hyphen - with the minus sign in figures, obtained with the plot command.
It should be − (UTF-16: 2212), not -.
How can I set it in the plot command?
Thank you

Answers (2)

KSSV
KSSV on 15 Jun 2022
str = 'UTF−16:2212' ;
figure
title(str)

Chunru
Chunru on 15 Jun 2022
Edited: Chunru on 15 Jun 2022
c1 = '−'; % (UTF-16: 2212), not -.
c2 = '-';
s1 = "both − and -"
s1 = "both − and -"
s2 = strrep(s1, c1, c2)
s2 = "both - and -"
contains(s1, c1)
ans = logical
1
contains(s2, c1)
ans = logical
0
subplot(121); title(s1)
subplot(122); title(s2)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!