how do I write 2^-x in MatLab?
6 ビュー (過去 30 日間)
古いコメントを表示
I need to run a algorithm where 2^(-x) is included.
0 件のコメント
回答 (2 件)
Fangjun Jiang
2023 年 2 月 17 日
x=1;
2^(-x)
1 件のコメント
John D'Errico
2023 年 2 月 17 日
編集済み: John D'Errico
2023 年 2 月 17 日
The parens are not technically needed there, but they don't hurt anything.
x = 1;
2^-x
And to be honest, I usually put a parens in something like that myself just to make it easier to read. Sometimes spare parens make things more clear, and sometimes they just create a confusing mess, creating a parenthetical balancing act.
参考
カテゴリ
Help Center および File Exchange で Web Services についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
