plot missing in matlab

the problem is that when i asked to plot an audio file it gives an error on the line of the plot

1 件のコメント

Walter Roberson
Walter Roberson 2021 年 5 月 26 日
Please show how you are asking to do the plotting, and show how you create the variables that you pass in to the plot call.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 5 月 26 日

0 投票

You cannot plot() a file by name. You need to read the data such as by using audioread(), and plot the data that results.

8 件のコメント

Ayman Shaban
Ayman Shaban 2021 年 5 月 26 日
i did that
Ayman Shaban
Ayman Shaban 2021 年 5 月 26 日
[g,fs] = audioread ('filename.wav');
sound(g,fs);
plot (g);
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
What is the error message?
Note: you should be using
t = (0:size(g,1)-1)/fs;
plot(t, g)
Ayman Shaban
Ayman Shaban 2021 年 5 月 26 日
Error in Untitled2 (line 4)
plot(t, g);
Ayman Shaban
Ayman Shaban 2021 年 5 月 26 日
i tried with definition t= but it is the same error
Walter Roberson
Walter Roberson 2021 年 5 月 26 日
Please show the complete error message, everything that is in red.
Ayman Shaban
Ayman Shaban 2021 年 5 月 26 日
Attempt to execute SCRIPT plot as a function:
D:\apps\matlab extracted\bin\plot.m
Error in Untitled2 (line 6)
plot(t, g);
Ayman Shaban
Ayman Shaban 2021 年 5 月 26 日
thank you, i solve the problem
it was because there is a file called plot.m in matlab files

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

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品

タグ

質問済み:

2021 年 5 月 26 日

コメント済み:

2021 年 5 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by