MATLAB Answers

How do I solve Error using linspace Too many input arguments.

16 views (last 30 days)
Madao Desu
Madao Desu on 23 Dec 2019
Edited: Uerm on 5 Jan 2020
when I use this code I get this error, how do I solve this problem ?
because of this I'm unable to use linspace in plotting, help would be appreciated.
>> x=(2*pi:1000);
y=sin(x);
z = cos(x);
plot(x,y,x,z)
xlabel( 'Time ' ), ylabel(' Amplitude ' ), title(' Continuous Waves ' )
legend(' Sine Wave ' , ' Cosine Wave ')
grid
>> x=linspace(0,2*pi,1000);
y=sin(x);
z = cos(x);
plot(x,y,x,z)
xlabel( 'Time ' ), ylabel(' Amplitude ' ), title(' Continuous Waves ' )
legend(' Sine Wave ' , ' Cosine Wave ')
grid
Error using linspace
Too many input arguments.
  2 Comments
Steven Lord
Steven Lord on 23 Dec 2019
To check what Aquatris hypothesizes, run this command and show us what it displays.
which -all linspace

Sign in to comment.

Accepted Answer

Uerm
Uerm on 23 Dec 2019
Hi,
I just tried to write your code and it seems to work for me... Try to clear all variables in Workspace and run the code again. I don't see any reason why it should not work.
  2 Comments
Uerm
Uerm on 5 Jan 2020
Have you tried the solutions above mentioned by Aquatris and Steven?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!