0

I am asked to plot the graph of a function in Matlab and I would like to add the x-axis and y-axis in the graph. But how can I achieve this?

Mary Star
  • 13,956
  • 2
    Although this is not the right place for such questions (stackoverflow probably is), what you want is probably the functions xlabel and ylabel. – Nitish Nov 15 '13 at 17:32
  • 2
    What do you mean "plot the x-axis and y-axis" do you want to plot labels, or data on the x and y axes? This question belongs on stackoverflow.com by the way. – Jeremy Upsal Nov 15 '13 at 17:33

1 Answers1

2

In Octave you can do:

x = [1:100]/10;
plot(x,sin(x),';legend;')
xlabel('xlabel')
ylabel('ylabel')
copper.hat
  • 172,524