Azzera filtri
Azzera filtri

Missing command in "line" (easy question)

4 visualizzazioni (ultimi 30 giorni)
Giorgos
Giorgos il 31 Mag 2016
Commentato: Walter Roberson il 31 Mag 2016
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

Risposte (1)

Walter Roberson
Walter Roberson il 31 Mag 2016
LineStyle
  2 Commenti
Giorgos
Giorgos il 31 Mag 2016
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]);
Walter Roberson
Walter Roberson il 31 Mag 2016
line([1 1],[0 1],'Color',[0 0 0], 'Linestyle', '--')

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by