Make MATLAB output in strict ASCII

6 ビュー (過去 30 日間)
marcel hendrix
marcel hendrix 2025 年 7 月 3 日
コメント済み: Walter Roberson 2025 年 7 月 6 日
MATLAB console output used high-ASCII sometimes, e.g. for its prompt ( » ). In R2025A it may output UTF8, e.g., for zpk() output:
z =
0×1 empty double column vector
p =
9.900494692205900e-01
k =
9.950657811787363e-03
This 'feature' is a nuisance when interchanging text with other programs. Is there a built-in function to convert these occasional UTF non-ASCII characters to a reasonable approximation in standard ASCII? ( like 'x' or '>>') ?
Or is this behavior to be considered a bug that will be fixed (there appear to be quite a few nuisance bugs in R2025a).
-marcel
  3 件のコメント
marcel hendrix
marcel hendrix 2025 年 7 月 6 日
> z = zeros(0,1)
One recognizes an expert by his concise examples :-) I actually used it just now to verify the problem.
Matlab R2023b did not use the 'small x'. (I have gone back to R2023b as I encountered a host of [what I consider to be] breaking changes in R2025a).
Walter Roberson
Walter Roberson 2025 年 7 月 6 日
I was wrong, by the way, in saying that 0xD7 required only one byte in UTF-8.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2025 年 7 月 3 日
Is there a built-in function to convert these occasional UTF non-ASCII characters to a reasonable approximation in standard ASCII? ( like 'x' or '>>') ?
No, there is no built-in function for that purpose.
Any such hypothetical built-in function would have to deal with the problem of contention about what the replacements should be. For example should × be replaced with x or with * or with by or with times ? The answer is likely to depend on context -- in some places × should be replaced by x but in some places it should be replaced by *
  7 件のコメント
Image Analyst
Image Analyst 2025 年 7 月 4 日
Can you post a screenshot?
Walter Roberson
Walter Roberson 2025 年 7 月 4 日
The prompt ( » ) is $C2 $BB, so MATLAB appears to emit UTF-16
That is UTF-8 rather than UTF-16

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by