Question
MATLAB Write a program that asks the user to input the initial velocity and firing angle of an object, and then the program calculates the
MATLAB
Write a program that asks the user to input the initial velocity and firing angle of an object, and then the program calculates the maximum distance and maximum height that the object reaches. Look up the "parabolic shot" formulas to solve this problem. Use the "input" and "fprintf" commands to solve this problem.
Below is the code I made, my question is where I use the fprintf function?
clc
clear all
g=9.81;
v=input('Enter the object initial velocity: ');
a=input('Enter the shot angle of the object: ');
Max Height Reached=v^2*(sin(a))^2/(2*g)
Max Distance Reached=v^2*(sin(2*a))/g
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