Professional Documents
Culture Documents
I have given the essential code. Simply change the characteristics according to your
requirement(the 'fp.______ = ' values). You can undoubtedly transform them to
satisfy to make the plot resemble the figure. I dont have MATLAB programming. Ran
it on Octave. The diagram was same. Expectation you comprehended the idea.
Soru 2
The code of the given program is attached below in the code block.
% Define x and fx
x = 0:0.5:15;
fx = @(x) 3 * x.^3 .* exp(-x) + x.^(3/2);
% Add legend
legend('f(x)', 'd(f)/dx');
Explanation:
Soru 3
%solution1
statesWithPositiveGrowthRateIn2009 = data.state(selectedRows1);
%solution2
stateWithPositiveGrowthIn2009AndNegativeIn2010 = data.state(selectedRows2);
%solution3
selectedRows3 = data.gdp_growth_2009 > 0 & data.gdp_growth_2010 > 0 &
data.gdp_growth_2011 > 0 & data.gdp_growth_2012 > 0;
stateWithPositiveGrowthInAllYear = data.state(selectedRows3);
stateWithNegativeGrowthInAllYear = data.state(~selectedRows3);
%solution4
stateWithZeroGrowthInAnyYear = data.state(selectedRows4);
%i didnt have the actual data so, showing u demo with dummy data
testData = data(5:10, :)
testData =
6×10 table
Var1 Var2 Var3 Var4 Var5 Var6 Var7 Var8 Var9 Var10
_________________ ____ ____ ____ ____ ____ ____ ____ ____ _____
testData.Var1(testData.Var3 < 0)
ans =
{'Connecticut'}
testData.Var1(testData.Var3 > 0)
ans =
5×1 cell array
{'Maine' }
{'Massachusetts'}
{'New Hampshire'}
{'Rhode Island' }
{'Vermont' }
ans =
{'Connecticut'}
testData.Var1(testData.Var3 < 0)
ans =
{'Connecticut'}
ans =
{'Maine' }
{'Massachusetts'}
{'New Hampshire'}
{'Rhode Island' }
{'Vermont' }
ans =
thankyou...........
Soru 4
======= matlab code for the asked problem===========
load crime.txt;
% 5 columns:
% column1 = crime
% column2 = household income
% column3 = house values
% column4 = latitude coordinate
% column5 = longitude coordinate