I was asked to create a function called mydrawing in Matlab to draw or plot lines onto a graph, using a so called pen.
The pen will start at the origin and will move along the +ve horizontal axis. The pen is also supplied with a list of commands in a form of a string, to draw or plot the lines onto the graph. The string commands are:
1) 'F' : the pen moves forward by x = 1.0
2) 'R' : the pen will turn right by a known angle
3) 'L' : the pen will turn left by a known angle
This function is written in such a way that if I type mydrawing(*insert the string*, *insert the angle*), I could draw or plot a square in the graph.
How do I code for these functions in Matlab?
In: Computer Science
Suppose the RTT between your host and marist.edu is 10 ms, between your host and nyu.edu is 20 ms, and between your host and albany.edu is 30 ms.
Assume parallel transmissions are not considered in this problem, that is, objects are obtained one after another.
a) How long does it take to load the entire webpage with HTTP 1.0?
b) How long does it take to load the entire webpage with HTTP 1.1?
In: Computer Science
As the electrons are accelerated through the second anode, the gain in kinetic energy is 2.0 x 10-15 J, and the speed of the electrons as they enter the region between the plates is 6.6 x 107 m/s. The electrons are moving to the right as they pass between the plates. The plates are 2.0 cm long, 1.0 mm apart, and as the electrons pass between the plates, the potential difference is 450 V. Determine the time it takes to pass the region between the plates. Determine the electric field strength between the plates. Determine the acceleration of the electron in the region between the deflection plates. Determine the vertical component of the velocity of the electrons when they emerge from the region between the plates. Determine the vertical displacement of the electrons as they are deflected.
In: Physics
In [12]: pd.Series([1.0,np.NaN,5.9,6])+pd.Series([3,5,2,5.6])
Out[12]: 0 4.0
1 NaN
2 7.9
3 11.6
dtype: float64
In [13]: pd.Series([1.0,25.0,5.5,6])/pd.Series([3,np.NaN,2,5.6])
Out[13]: 0 0.333333
1 NaN
2 2.750000
3 1.071429
dtype: float64
What are they trying to explain here?
That pandas returns a missing value where one of the operands is missing
That pandas treats NaN values as zero, when an operation is performed
That pandas removes all records in which one of the operands is NaN
That the + and / operations in pandas are special cases in which the NaN values are treated as floats. The rest of the mathematical operations treat NaN values as strings.
In: Computer Science
In an attempt to reduce the extraordinarily long travel times for voyaging to distant stars, some people have suggested traveling at close to the speed of light. Suppose you wish to visit the red giant star Betelgeuse, which is 430 ly away, and that you want your 20,000 kg rocket to move so fast that you age only 24 years during the round trip.
A) How fast, as a fraction of c, must the rocket travel relative to earth?
B) How much energy is needed to accelerate the rocket to this speed?
C) Compare this amount of energy to the total energy E0 used by the United States in the year 2015, which was roughly 1.0×1020 J.
In: Physics
1) When 0.119 g of Zn(s) is combined with enough HCl to make 51.6 mL of solution in a coffee-cup calorimeter, all of the zinc reacts, raising the temperature of the solution from 22.4 ∘C to 23.9 ∘C. Find ΔHrxn for this reaction as written. (Use 1.0 g/mL for the density of the solution and 4.18 J/g⋅∘C as the specific heat capacity.)
2)Calculate ΔHrxn for the following reaction:
CaO(s)+CO2(g)→CaCO3(s)
Use the following reactions and given ΔH values:
Ca(s)+CO2(g)+12O2(g)→CaCO3(s), ΔH= -812.8 kJ
2Ca(s)+O2(g)→2CaO(s), ΔH= -1269.8 kJ
In: Chemistry
In an attempt to reduce the extraordinarily long
travel times for voyaging to distant stars, some people have
suggested traveling at close to the speed of light. Suppose you
wish to visit the red giant star Betelgeuse, which is 430 ly l y
away, and that you want your 20,000 kg k g rocket to move so fast
that you age only 38 years during the round trip.
How fast must the rocket travel relative to
earth?
How much energy is needed to accelerate the rocket to
this speed?
How many times larger is this energy than the total
energy used by the United States in the year 2000, which was
roughly 1.0×1020J1.0×1020J?
In: Other
Two sample t-test:
Suppose you are interested in deciding if the 1990 toyota four runner has been equally as reliable as the 1990 honda passport. You go out and randomly sample 5 people who own a 1990 toyota and 5 other people who own a 1990 honda and ask them how often they take their vehicles in for maintenance. Here is the data (in thousands of miles)
Honda: 29, 33, 28, 31, 27
Toyota: 31, 35, 32, 34, 30
a. state the null and the alternative hypotheses
b. compute the means and standard deviations of the two samples
c. compute the two-sample t-statistic
d. how many degrees of freedom?
e. compute p-value
f. at an alpha= 0.05 would you accept of reject the null hypothesis?
In: Statistics and Probability
An automotive researcher wanted to estimate the difference in distance required to come to a complete stop while traveling 40 miles per hour on wet versus dry pavement. Because car type plays a role, the researcher used eight different cars with the same driver and tires. The breaking distance (in feet) on both wet and dry pavement is shown in the data below. Car 1 2 3 4 5 6 7 8 Wet 107 101 109 112 105 106 111 108 Dry 72 69 74 73 76 75 78 81 a) Construct a 99% Confidence Interval for the mean difference in stopping distance between wet and dry roads. b) Test whether there is a difference in stopping distances between wet and dry roads at 1% level of significance.
In: Statistics and Probability
In its Fuel Economy Guide for 2014 model vehicles, the Environmental Protection Agency gives data on 1134 vehicles. The combined city and highway gas mileage of these 1134 vehicles is approximately Normal with mean 22.2 miles per gallon (mpg) and standard deviation 5.2 mpg. (a) The 2014 Volkswagen Beetle with a four-cylinder 1.8 L engine and automatic transmission has combined gas milage of 28 mpg. What percent of all vehicles have better gas mileage than the Beetle? (b) How high must a 2014 vehicle’s gas milage be to fall in the top 5% of all vehicles? (c) The quintiles of any distribution are the values with cumulative proportions 0.20, 0.40, and 0.80. What are the quintiles of the distribution go gas mileage?
In: Statistics and Probability