Error in code for plot
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Cameron Paterson
il 7 Nov 2021
Risposto: Steven Lord
il 7 Nov 2021
x=linspace(0,2.*pi,101)
plot(x,sin(x),'markeredgecolor','r',x,cos(x),'markeredgecolor','g',x,tan(x),'markeredgecolor','b',x,cot(x),'markeredgecolor','c',x,sec(x),'markeredgecolor','m',x,csc(x),'markeredgecolor','y','linewidth',1.5)
ylabel('Trigonometric Function')
xlabel('Angle (\theta)')
legend('southwest')
axis([0 2.*pi -5 5])
grid on
0 Commenti
Risposta accettata
Steven Lord
il 7 Nov 2021
x=linspace(0,2.*pi,101)
plot(x,sin(x),'markeredgecolor','r',...
x,cos(x),'markeredgecolor','g',...
x,tan(x),'markeredgecolor','b',...
x,cot(x),'markeredgecolor','c',...
x,sec(x),'markeredgecolor','m',...
x,csc(x),'markeredgecolor','y'...
,'linewidth',1.5)
You cannot put name-value pair arguments in the middle of data inputs. Either make these separate calls to plot (using hold on to put all the lines on the same axes) or call plot with an output argument and set the properties on the handles stored as elements of that output argument.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Line Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!