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 output


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -