I have a matrix with 5 columns and I want to plot the fifth one. I also want MATLAB to use dots for the graph and to label the x and y axis. I use plot(matrixname(:,5)) but can't get the graph have dots. Any help is appreciated.

I have a matrix with 5 columns and I want to plot the fifth one. I also want MATLAB to use dots for the graph and to label the x and y axis. I use plot(matrixname(:,5)) but can't get the graph have dots.

 Accepted Answer

Try this:
plot(matrixname(:,5), '.')

4 Comments

Hello! Thank you for the quick feedback but with your code, I lost my graph. I attach the plots I had with two different codes. plot(dat(:,5)) this is what I tried. plot(dat(:,5), '.') How can I also label the axes with x and y?- Just figured labelling.
My pleasure.
You didn’t lose your graph — the dots are plotted at ±1. If you want lines and dots, and see them easily, do this:
figure(1)
plot(matrixname(:,5), '-.')
axis([xlim -1.5 1.5])

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!