How do I solve Error using linspace Too many input arguments.
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
Aquatris
2019-12-23
You might have a custom linspace function in your directory. So when you call the linspace function, it does not call the built-in one.
Steven Lord
2019-12-23
To check what Aquatris hypothesizes, run this command and show us what it displays.
which -all linspace
采纳的回答
Uerm
2019-12-23

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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!