%Read the image
I1950 = imread('1950.png');
I1985 = imread('1985.png');
I2000 = imread('2000.png');
I2005 = imread('2005.png');
I2010 = imread('2010.png');
I2020 = imread('2020.png');
%Display the image
subplot(3, 2, 1);
imshow(I1950);
subplot(3, 2, 2);
imshow(I1985);
subplot(3, 2, 3);
imshow(I2000);
subplot(3, 2, 4);
imshow(I2005);
subplot(3, 2, 5);
imshow(I2010);
subplot(3, 2, 6);
imshow(I2020);
%Identify Green and Yellow Pixels for image 1950
countG = 0;
countY = 0;
[x, y, z] = size(I1950);
for i = 1:x
for j = 1:y
for k = 1:z
%Check for Green Pixels
if I1950(i, j, k)>=75 && I1950(i, j, k)<=115
countG = countG+1;
%Check for Yellow Pixels
elseif I1950(i, j, k)~=0 && I1950(i, j, k)~=240
countY = countY+1;
end
end
end
end
%Calculate PFA
PFA = countG*100/(countG+countY);
%Write to file
fileID = fopen('BorneoForestData.txt', 'w');
fprintf(fileID, 'Year Forest Area Total Land Area PFA ');
fprintf(fileID, '%d %d %d %f ', 1950, countG, countG+countY,
PFA);
%Identify Green and Yellow Pixels for image 1985
countG = 0;
countY = 0;
[x, y, z] = size(I1985);
for i = 1:x
for j = 1:y
for k = 1:z
%Check for Green Pixels
if I1985(i, j, k)>=75 && I1985(i, j, k)<=115
countG = countG+1;
%Check for Yellow Pixels
elseif I1985(i, j, k)~=0 && I1985(i, j, k)~=240
countY = countY+1;
end
end
end
end
%Calculate PFA
PFA = countG*100/(countG+countY);
%Write to file
fprintf(fileID, '%d %d %d %f ', 1985, countG, countG+countY,
PFA);
%Identify Green and Yellow Pixels for image 2000
countG = 0;
countY = 0;
[x, y, z] = size(I2000);
for i = 1:x
for j = 1:y
for k = 1:z
%Check for Green Pixels
if I2000(i, j, k)>=75 && I2000(i, j, k)<=115
countG = countG+1;
%Check for Yellow Pixels
elseif I2000(i, j, k)~=0 && I2000(i, j, k)~=240
countY = countY+1;
end
end
end
end
%Calculate PFA
PFA = countG*100/(countG+countY);
%Write to file
fprintf(fileID, '%d %d %d %f ', 2000, countG, countG+countY,
PFA);
%Identify Green and Yellow Pixels for image 2005
countG = 0;
countY = 0;
[x, y, z] = size(I2005);
for i = 1:x
for j = 1:y
for k = 1:z
%Check for Green Pixels
if I2005(i, j, k)>=75 && I2005(i, j, k)<=115
countG = countG+1;
%Check for Yellow Pixels
elseif I2005(i, j, k)~=0 && I2005(i, j, k)~=240
countY = countY+1;
end
end
end
end
%Calculate PFA
PFA = countG*100/(countG+countY);
%Write to file
fprintf(fileID, '%d %d %d %f ', 2005, countG, countG+countY,
PFA);
%Identify Green and Yellow Pixels for image 2010
countG = 0;
countY = 0;
[x, y, z] = size(I2010);
for i = 1:x
for j = 1:y
for k = 1:z
%Check for Green Pixels
if I2010(i, j, k)>=75 && I2010(i, j, k)<=115
countG = countG+1;
%Check for Yellow Pixels
elseif I2010(i, j, k)~=0 && I2010(i, j, k)~=240
countY = countY+1;
end
end
end
end
%Calculate PFA
PFA = countG*100/(countG+countY);
%Write to file
fprintf(fileID, '%d %d %d %f ', 2010, countG, countG+countY,
PFA);
%Identify Green and Yellow Pixels for image 2020
countG = 0;
countY = 0;
[x, y, z] = size(I2020);
for i = 1:x
for j = 1:y
for k = 1:z
%Check for Green Pixels
if I2020(i, j, k)>=75 && I2020(i, j, k)<=115
countG = countG+1;
%Check for Yellow Pixels
elseif I2020(i, j, k)~=0 && I2020(i, j, k)~=240
countY = countY+1;
end
end
end
end
%Calculate PFA
PFA = countG*100/(countG+countY);
%Write to file
fprintf(fileID, '%d %d %d %f ', 2020, countG, countG+countY,
PFA);
Screenshot of BorneoForestData.txt
Screenshot of Image:
4 MARKS QUEStION 3 Background You are part of a team working for the United Nations...
Q3b In the Q3b.m file, plot the PFA against the year as blue circles in a new figure. You believe that the data can be appropriately represented by either an exponential model or a 2d order polynomial model. Find the coefficients for each model based on the form of the equations below: Exponential model: PFA- aeBt 2 order polynomial model: PFA at2 + bt + c where a. B, o, b, c are coefficients, and t represents the year Plot...
using matlab thank you 3 MARKS QUESTION 3 Background The van der Pol equation is a 2nd-order ODE that describes self-sustaining oscillations in which energy is withdrawn from large oscillations and fed into the small oscillations. This equation typically models electronic circuits containing vacuum tubes. The van der Pol equation is: dt2 dt where y represents the position coordinate, t is time, and u is a damping coefficient The 2nd-order ODE can be solved as a set of 1st-order ODEs,...
Mountain Paths (Part 1) in C++ Objectives 2d arrays Store Use Nested Loops Parallel data structures (i.e. parallel arrays … called multiple arrays in the zyBook) Transform data Read from files Write to files structs Code Requirements Start with this code: mtnpathstart.zip Do not modify the function signatures provided. Do not #include or #include Program Flow Read the data into a 2D array Find min and max elevation to correspond to darkest and brightest color, respectively Compute the shade of...