matlab
>> 3+2
ans =
5
>> 3+2;
% input data
papers = [105, 63, 20, 17, 7, 39];
country = {'United States', 'Japan', 'United Kingdom',
'Germany', 'Italy', 'Others'};
total = sum(papers);
% draw bar graph (vertical)
bar(papers)
ylabel('Number of Papers on Diamond Thin Film Research');
title('Frequency Bar Graph for Diamond Thin Film Data');
% "gca" gets the handle for the current axes
set(gca, 'XTickLabel', country);
% draw relative frequency bar graph (horizontal)
barh(papers./total)
set(gca, 'YTickLabel', country);
xlabel('Relative Frequency of Papers on Diamond Thin Film Research');
title('Relative Frequency Bar Graph for Diamond Thin Film Data');
% draw Pareto diagram
[newpapers, index] = sort(papers);
bar(newpapers)
set(gca, 'XTickLabel', country(index));
ylabel('Number of Papers on Diamond Thin Film Research');
title('Frequency Bar Graph for Diamond Thin Film Data');
Getting Help
>> helpwinYou can virtually be on yourself once you know how to get help.
>> lookfor key_words >> help command_name
Print Graphics
Leaving Matlab
>> save mywork.mat >> exitYou can find you have a new file called "mywork.mat" in your current directory. Next time when you start matlab at the same directory, you can restore all your results by typing
>> load mywork.mat