USING MATLAB...Write a function that creates a structure variable called createSpacecraft. The function should take four inputs, a number called mass (in kg), a number called fuel (in joules of energy), a number called orbit (in meters), and a number called engine (in newtons). It should return an output structure called spacecraft containing each of those values. Please ensure that both the function name, AND the names of variables within the spacecraft structure are exactly as instructed
MATLAB Function:
function spacecraft = createSpacecraft (mass, fuel, orbit,
engine)
% Function that creates the spacecraft structure with the given
fields
% Creating SpaceCraft
spacecraft =
struct("mass",mass,"fuel",fuel,"orbit",orbit,"engine",engine);
end % function end
__________________________________________________________________________________________________
Sample Run:

USING MATLAB...Write a function that creates a structure variable called createSpacecraft. The function should take four...
PLEASE ONLY DO D IN MATLAB. I DID A B AND C, dont need
them.
Intro to Computers for Engineers Recitation 11 In today's class, we are modeling a spacecraft. Please submit all functions you write. Pay very careful attention to names. If you name a function differently from what you are instructed, things might not work. Test your code using the scripts siml.m and sim2.m before trying to submit on zyLabs. A. [Submit on zyLabs] Write a function that...
answer in matlab please
Create a separate function file fieldtovar.m that receives a single structure as an input and assigns each of the field values to user-defined variables. The function should work for a structure with any number of fields. Additionally, implement an error check to ensure that the number of user- defined variables (output arguments) is equal to the number of structure fields. Here are two examples of calling the function: » Boeing_747 = struct('Length', 70.6, WingSpan', 64.4, 'Engine',...
Using MatLab Write a function called PrimeFinder that receives an integer n as an input argument, and provides an output argument called Primes that is a vector containing all prime numbers between 2 and n, inclusive. Verify the correctness of your code with inserting 13 as the input argument, and check that your output is Primes = [2,3,5,7,11,13]. You are NOT allowed to use any directly relevant MATLAB built-in function such as divisors, etc. NOTE: A prime number is a...
Problem 1: Write a function ProcessiClicker to take any sized table as an input with at least two string column variables LastName and Firstname, and removes any leading and trailing whitespace from variables in LastName and Firstname, and combines the resulting two columns variables into one column named StudentName, with only comma between the last name and the first names. For example, if one record entry in Lastname and Firstname contains " Jones " and " Adam", the final result...
Problem 3: Write a MATLAB function called cubic_spline to compute the natural cubic spline for a given data set. The x and y data points and the rdesired values (a vector) should be the inputs, and the corresponding ydesired values (a vector) should be the output.
PYTHON
The first function you will write should be called ‘countDown’.
Your function should take zero (0) arguments. The function should
return one (1) list containing integers from 10 to 1 and finally,
the string “Liftoff!”. (i.e., [10, 9, 8, 7, 6, 5, 4, 3, 2, 1,
‘Liftoff!’]). You function must be recursive (i.e., it should
contain a call to itself within the function body). You will get NO
credit if you use any loops (for, while, etc).
3. Function...
·Write a Cl Calculator in MATLAB (function name ci_calc.m). Your function should take four input arguments: σ, x,n, p% Confidence Interval Calculator σ (Std Dev) Sample mean Sample size Confidence level 577.4 37.4556 100 90% Numeric input Numeric input Numeric input Numeric input Lower limit of Cl -57.52 Numeric output Upper limit of Cl 132.43 Numeric output
8. Write a MATLAB function that will take as inputs a set of data (x,y) and output the best estimate of the integral using a Romberg Array. The function should perform two trapezoidal integrations using the full interval and half the interval, and then combine these integrations in a Romberg Array. Your function should also output the relative error of the integral. Please note that the data entered may not be evenly spaced and your function should make sure that...
Write a MATLAB function that uses Simpson’s 1/3 method ( to integrate any function) to estimate an even more accurate value of the integral using Richardson extrapolation. The function should have the following inputs: the function name, the integration range, and the number of intervals. It should output as an argument the numerical value of the integral. The function should stop with an error message if an inappropriate number of intervals are requested.
MATLAB Only MATLAB Only MATLAB Only Indicated in the script below, write a function, called arbpoly3, that accepts two inputs: i) a row vector, called c, containing the coefficients of the polynomial, starting with the coefficient for the lowest degree term, which is the constant term. ii) a row vector, called x, which is the set of real numbers where the polynomial is to be evaluated. The output, y, will be a vector containing the values of the polynomial, evaluated...