+, plus Type Conversion Behavior, Matlab Copilot Mismatch

With regard to type conversion behaivor, there appears to be a direct conflict Matlab's behavior and Matlab Copilot responses. See the command window interaction below and compare it to the claim in the Copilot response. I check help for the +, plus function and it does not address this topic. What is the expected behavior? This is not new behavior. I have it documented from several years ago.

回答 (1 件)

Walter Roberson
Walter Roberson 約6時間 前

0 投票

The copilot descriptive text says specifically that the result of a+b will be integer. But then the comment says that it will be double. The text is correct: the results of pairwise mixed class arithmetic (when permitted at all) is the most restrictive class.

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

製品

リリース

R2025b

質問済み:

2026 年 3 月 3 日 16:59

回答済み:

2026 年 3 月 3 日 20:37

Community Treasure Hunt

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

Start Hunting!

Translated by