フィルターのクリア

I'm keep getting " index exceeds matrix dimension"

2 ビュー (過去 30 日間)
Shira Arluk
Shira Arluk 2019 年 12 月 15 日
編集済み: Shira Arluk 2019 年 12 月 15 日
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 件)

カテゴリ

Help Center および File ExchangeTitle についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by