MATLAB: Iterate Through a Loop Array -
in matlab, need create loop iterate through entire string array , plot.
in other words, first iteration: loop steps montana value (23,45) , generates plot.
second iteration: continue loop georgia value (54,75) , plot.
third iteration: continue loop texas value (55,90) , plot. so, have 3 different plots each string.
here array:
a = {'montana','georgia','texas'};
with x values:
x = [23, 54, 55]
with y values:
y = [45, 75, 90]
thanks,
amanda
% input data = {'montana','georgia','texas'}; x = [23, 54, 55]; y = [45, 75, 90]; % plot points figure(1); plot(x, y, 'rx'); % adjust limits figure axis axis([0 70 0 100]); % label points text(x,y, a, 'verticalalignment','bottom', ... 'horizontalalignment','right');
the output figure
Comments
Post a Comment