Missing command in "line" (easy question)

Hello Guys/girls,
I want to make a line using the "line" command:
line([0 1],[1 1],'color',[0 0 0 ],' missing command for dashed line')
what is the addition if I want to make this line dashed, "-" doesnt seem to work. Cant find something on the internet
Thanks, G

Answers (1)

LineStyle

2 Comments

Thank you for you replay,
The "LineStyle = Dashed" addon does not seen to work, but rather generates an invalid error message..
t = 0:0.1:3;
y = trapmf(t,[0 1 2 3]);
plot (t,y, 'k', 'LineWidth',2);
set(gca,'XTickLabel',{'0','t_{acc}','','t_{max}','','t_{dec}','t_{total}'})
set(gca,'YTickLabel',{'0','','\omega_{max}'})
axis ([ 0 3 -0 1.5]);
xlabel ('Time [sec]');
ylabel ('Angular Velocity');
title('Velocity Profile of Rotary Actuator')
hold on
line([1 1],[0 1],'Color',[0 0 0]); %<---- HERE I NEED DASHED LINE
line([2 2],[0 1],'Color',[0 0 0]);
annotation('arrow',[0.28 0.39],...
[0.08 0.08]);
line([1 1],[0 1],'Color',[0 0 0], 'Linestyle', '--')

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Tags

Asked:

on 31 May 2016

Commented:

on 31 May 2016

Community Treasure Hunt

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

Start Hunting!