Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Homework 5: Write one MATLAB program and make use of the MATLAB’s menu function that creates three (3) interactive menu buttons to solve the following 3 problems. Label the buttons, for example, as...

1 answer below »
Homework 5:
Write one MATLAB program and make use of the MATLAB’s menu function that creates three (3)
interactive menu buttons to solve the following 3 problems. Label the buttons, for example, as
‘Solution 1’, ‘Solution 2’, and ‘Solution 3’. Present one solution when each menu button is clicked.
Menu Example:
choice = menu('Click a button:','Button 1','Button 2’,'Button 3');
switch choice
case 1
XXXXXXXXXXdisp(‘You clicked button 1.’)
case 2
XXXXXXXXXXdisp(‘You clicked button 2.’)
case 3
XXXXXXXXXXdisp(‘You clicked button 3.’)
end
Problem 1:
The electrical circuit shown consists of resistors and voltage sources. Determine the cu
ent in each
esistor, using the mesh cu
ent method based on Kirchhoff’s voltage law.
V1 = 12 V, V2 = 24 V
R1 = 20 Ω, R2 = 12 Ω, R3 = 8 Ω, R4 = 6 Ω, R5 = 10 Ω
(The result for X should be [-1.2667; XXXXXXXXXX; 0.5587; 0.2095])
Print the answer on screen in the following format:
The cu
ent in resister R1 is XXXXXXXXXXA.
The cu
ent in resister R2 is XXXXXXXXXXA.
The cu
ent in resister R3 is XXXXXXXXXXA.
The cu
ent in resister R4 is XXXXXXXXXXA.
The cu
ent in resister R5 is XXXXXXXXXXA.
Problem 2:


(Here is an example answer. Scaling the y axis to 150 is optional.)


Problem 3:
(The answer should look like the following figure.)

Zip the entire hw5 folder.
Rename the hw5.zip to LastName_FirstName_ME105_hw5.zip
Submit the .zip file to Moddle.
Answered Same Day Apr 03, 2021

Solution

Akriti answered on Apr 17 2021
128 Votes
Problem 2.zip
Problem 2/Ball_Trajectory.m
% Problem 2
%Number of bounces:
N=5;
%Number of points of interest between bounces:
PI=10;
%Velocity reducing facto
VRF=0.8;
%Acceleration of gravity, m/s^2:
g=9.81;
%Initial velocity of the ball, m/s:
V_0=20;
%Initial angle of trajectory, deg:
Alpha=25;
%Initial angle of trajectory, deg:
Theta=30;
V=zeros(N+1,4);
V(1,1)=V_0;
for r=1:N
%Projection of the Initial velocity to X axis, m/s:
V(r,2)=V(r,1)*cosd(Alpha)*sind(Theta);
%Projection of the Initial velocity to Y axis, m/s:
V(r,3)=V(r,1)*sind(Alpha)*sind(Theta);
%Projection of the Initial velocity to Z axis, m/s:
V(r,4)=V(r,1)*cosd(Theta);
%The ball initial velocities after each bounce, m/s:
V(r+1,1)=V(r,4)*VRF;
end
%Time beteween bounces, s:
T_b=2*V(1:N,4)/g;
%Increment of time, s:
IT=T_
PI;
T=zeros(N,PI+1);
for k=1:N
for m=1:PI+1
T(k,m+1)=T(k,m)+IT(k);
end
end
%X coordinate of the ball due to time, m:
XD=zeros(N,PI+1);
for k=1:N
for m=1:PI+1
XD(k,m)=T(k,m)*V(k,2);
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here