Question
Write a MATLAB function that would read the parameters stored in a file named missile_data.txt into MATLAB. The function should have the following declaration: function
Write a MATLAB function that would read the parameters stored in a file named "missile_data.txt" into MATLAB. The function should have the following declaration: function [X0, Y0, Z0, m0, mf, Thmag0, theta, phi, Tburn] = read input( input filename, M_id) where input_filename is a string variable denoting the name of the file to be read and M_id is an integer which denotes the missile ID. The outputs are the initial position (X0, Y0, Z0), initial and landing mass (m0, mf), initial thrust magnitude (Thmag0), aunch angles (theta and phi) and burn time (T burn). When the input M_id is not available in the file, the function should set all outputs to NaN and display an error warning message to screen. You might want to consider function importdata or textscan to read the parameters
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started