Im having trouble loading a program to explore the output using Plot Command

We were asked to upload a code and use plot command to explore the output, but the code I uploaded is receiving errors, please help
load handel
sound (y,Fs)
multiplier = 0.10 ;
noise = randn(length(y),1) * multiplier ;
%% Explore This
sound_w_noise = y + noise ;
sound (sound_w_noise,y) ;
t = 1:length(y) ;
plot(sound_w_noise,1:200,t)
Error using sound (line 76)
Operands to the || and && operators must be convertible to logical scalar values.
Error in PlotCommandExploration (line 17)
sound (sound_w_noise, y) ;
This is the code I was told to upload and the errors I'm receiving. I have no idea where to start

回答(1 个)

load handel
sound (y,Fs)
multiplier=0.10 ;
noise=randn(length(y),1)*multiplier ;
%% Explore This
sound_w_noise=y+noise ;
sound(sound_w_noise) ;
t=1:length(y) ;
plot(sound_w_noise,t);
kk.png

1 个评论

Thank You!! I found my error. Now how would I examine the first 200 data points only in my plot?

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by