I'm keep getting " index exceeds matrix dimension"
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hey, I'm very new to matlab. We got an assignment to plot some data about ratings of cities in the USA, in 9 different catagories. (it is a famous data in MATLAB).
This is the assignment-
"Plot all the data for each city under one figure and add a legend containing category names. Use the xlabel, xlim, title, legend functions."
this is my code and the figure seems to come out right but i keep getting this warning- "In legend (line 118)
Index exceeds matrix dimensions."
r = figure(3);
hold on
for i= 1:size(names,1)
plot(ratings(:,i))
title('cities rankings by categories');
legend('climate','housing','health','crime','transportation','education','arts','recreation','economics');
xlabel('City ID');
xlim([0 329]);
end
I don't know what's the problem..cause I do get the figure.
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Title finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!