Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
MatLabBigDataProject/Final.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
113 lines (57 sloc)
3.5 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(~isdeployed) | |
cd(fileparts(which(mfilename))); | |
end | |
DataPath = '.\'; | |
AvailableFiles = dir((fullfile(DataPath, '*.fig'))); % list available data files | |
disp('Colourblind Diseases. 1. Protanopia 2. Deuteranopia 3. Tritanopia') % displaying the most 3 common diseases | |
prompt = "Select your disease if you have one or press any other key of you don't have one "; % asking for user input | |
colorblind = input(prompt); % accepting user input and passing it to colorblind variable | |
for idx = 1: size(AvailableFiles,1) | |
tic % Initializing the Counting of the Time that takes for the program to run | |
OpenFileName = AvailableFiles(idx).name; % Assigning the filename that we are going to read the data | |
fig = openfig(OpenFileName); % Opening the file | |
Ozone = fig.Children.Children.ZData; % Assigning Z data | |
X = double(fig.Children.Children.XData); % Assigning X data | |
Y = double(fig.Children.Children.YData); % Assigning Y data | |
if (fig.Number() <=0) % Testing if the file has openned | |
error("File not Opened , Exitting Program") % Producing an error if it didn't open | |
end | |
worldmap('Europe'); % set the part of the earth to show | |
load coastlines % loading the coastlines | |
plotm(coastlat,coastlon) % plotting the data | |
surfm(Y,X,Ozone) % passing the values to the map | |
if (colorblind == 1) % checks if the user suffers from Red-Green Color deficiency | |
setm(gca,"mapprojection","eqdcylin") % assigning the map that we are going for in each figure | |
colormap hot % using colormap so the person with that disease can see the map correctly | |
elseif (colorblind == 2) % checks if the user suffers from green weakness Color deficiency | |
setm(gca,"mapprojection","eqdcylin") % assigning the map that we are going for in each figure | |
colormap hot % using colormap so the person with that disease can see the map correctly | |
elseif (colorblind == 3) % checks if the user suffers from Blue/Yellow Color deficiency | |
setm(gca,"mapprojection","eqdcylin") % assigning the map that we are going for in each figure | |
colormap hsv % using colormap so the person with that disease can see the map correctlyelse | |
else | |
setm(gca,"mapprojection","eqdcylin") % assigning the map that we are going for in each figure | |
end | |
land = shaperead('landareas', 'UseGeoCoords', true); % assigning lands | |
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5]) | |
lakes = shaperead('worldlakes', 'UseGeoCoords', true); % assigning lakes | |
geoshow(lakes, 'FaceColor', 'blue') | |
rivers = shaperead('worldrivers', 'UseGeoCoords', true); % assigning rivers | |
geoshow(rivers, 'Color', 'blue') | |
cities = shaperead('worldcities', 'UseGeoCoords', true); % assigning cities | |
geoshow(cities, 'Marker', '.', 'Color', 'red') | |
% sets the visibility of the various parts of the | |
% plot so the land, cities etc shows through. | |
Plots = findobj(gca,'Type','Axes'); | |
Plots.SortMethod = 'depth'; | |
toc % Printing elapsed time | |
elapsedTime = toc; | |
% Testing that it doesnt take more than 10 seconds to print a figure | |
if (elapsedTime > 10) | |
error("Exited Time Limits, Program Terminating") | |
end | |
% kill the program if it takes more than 10 seconds to print a figure | |
disp("Press any key to open the next figure!") %% Asking for User input to continue the program | |
pause() % Waiting for user input before printing the next figure | |
end | |
close all % closing all figures before ending the program. | |