instructor gave us set(gca,'XTick',1:length(numVal)); how do i use this for setting color to inputs?
Show older comments
set(gca,'XTick',1:length(numVal)); set(gca,'XTickLabel',numVal(1,:));
the task is to set the inputs we put in to the line color in plotting, I imagine this set has something to do with it, can anyone explain this? Having a hard time setting the inputs as the color of my lines in plotting.
1 Comment
dpb
on 5 Dec 2014
The above set has nothing whatsoever to do with colors so it's irrelevant to the question subject. All this does is set the number of tick marks and their labels to the values in the first row of the array numVal. (BTW, the use of length here isn't robust coding;
length(X)=max(size(X)); % by definition
so if the array were to happen to have more rows than columns, there would be a mismatch and an error raised. If, numVal is a vector, then the second size value is 1 so it works, but then the subscripting expression (1,:) is totally superfluous).
Accepted Answer
More Answers (1)
Richard
on 5 Dec 2014
0 votes
Categories
Find more on Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!