How to multiply array by -1?

4 ビュー (過去 30 日間)
Sean Roh
Sean Roh 2021 年 3 月 2 日
回答済み: Sai Veeramachaneni 2021 年 3 月 5 日
I want to invert all the values in the array by -1.
[x,fs] = audioread('400hz.mp3'];
y=-1*x;
soundsc(y,fs);
  1 件のコメント
Stephen23
Stephen23 2021 年 3 月 2 日
Simpler:
y = -x;

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

回答 (1 件)

Sai Veeramachaneni
Sai Veeramachaneni 2021 年 3 月 5 日
Hi,
You can use y = -x or y = -1.*x

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by