Clear Filters
Clear Filters

putting an exception in the plot command

1 view (last 30 days)
Hi.
I am plotting columns 1:20 except 5:7, how can I put in the plot command? Thanks

Accepted Answer

José-Luis
José-Luis on 9 Aug 2017
Edited: José-Luis on 9 Aug 2017
You could use setdiff() to do the indexing:
data = rand(10,20);
plot(data(:,setdiff(1:20,5:7)));
Please accept the answer that best solves your problem.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!