Programming Assignment WCL v3
.docx
keyboard_arrow_up
School
Florida International University *
*We aren’t endorsed by this school
Course
1008C
Subject
Mechanical Engineering
Date
Dec 6, 2023
Type
docx
Pages
3
Uploaded by MegaMonkeyMaster377
BME 1008c MATLAB Programming Assignment
Spring 2022
Assignment #1 (10 points)
Due Date: 2/11
Develop a
flowchart
for an interactive program that documents the vital signs of the user daily. The
flowchart should include the following features:
(1)
It records at least heart rate, SatO2, temperature, and breathing rate.
(2)
It records the time at which the user inputs the data.
(3)
It checks the accuracy of the inputs.
(4)
It stores the inputs in a local file.
(5)
It sends the record (i.e., local file) to the user’s physician for review.
(6)
It obtains the diagnosis/recommendations from the user’s physician every 14 days.
Assignment #2 (10 points)
Due Date: 3/11
Develop an interactive MATLAB program that records vital signs (i.e., user interface). The program will
ask the user to input his/her vital signs (heart rate, SatO2, and body temperature) and store the inputs in
a local file.
(1)
Develop a flowchart for this program.
a.
Request user input.
b.
Save the inputs in a local variable.
c.
Display the input summary.
Save the inputs in a local file.
(2)
Convert each block to MATLAB codes.
Submission Example
Element
MATLAB Code
Clear all;
prompt = ‘Please enter your heart rate in beats/min’;
hr = input(prompt);
Reference
https://www.mathworks.com/help/MATLAB/ref/input.html
Assignment #3 (10 points)
Start
Get user’s
heart rate
BME 1008c MATLAB Programming Assignment
Spring 2022
Due Date: 4/5
Develop a MATLAB program that reads and plots the vital sign data collected during Week 1.
(1)
Develop a flowchart for this program.
a.
Request the data file name.
b.
Read the data file in.
c.
Plot the vital sign data from one team member.
d.
Repeat Steps a – c until the vital sign data from all team members are imported.
e.
Plot the vital sign data from all team members.
Provide a plot example (via excel)
(2)
Convert each block to MATLAB Codes.
Assignment #4 (30 points)
Due Date: 4/22
Revise the program developed in the first assignment to incorporate input verification.
(1)
Develop a flowchart for this program.
a.
Request user input.
b.
Verify the input.
c.
Save the correct input in a local variable.
d.
Display all the inputs
e.
Save the collected inputs in a local file.
(2)
Convert each block to MATLAB codes.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
The following tools / resources may be useful for you to complete the assignment:a. Chatgpt (You may use it to learn Matlab coding or any other computer language. An example is given here: https://shareg.pt/mXHGne9 ). Please take note that code generated by chatgpt can be directly copied and pasted.b. Matlabi) Useful cheat sheet (https://n.ethz.ch/~marcokre/download/ML-CheatSheet.pdf)ii) Getting started with Matlab (https://matlabacademy.mathworks.com/en/details/gettingstarted )iii) Getting 30-day Matlab trial license (https://www.mathworks.com/campaigns/products/trials.html ) iv) Polyfit (https://www.mathworks.com/help/matlab/ref/polyfit.html )v) Exponential Fit (https://www.mathworks.com/matlabcentral/answers/91159-how-do-i-fit-an-exponential-curve-to-my-data)c. PlotDigitizer (https://plotdigitizer.sourceforge.net/ ) or a free online app that does not requires installation (https://plotdigitizer.com/app )You may use your own engineering judgement to make any assumptions on any…
arrow_forward
I need help with simulink. It is my first time using simulink. I am trying to make a simulink program turning on the LED on the board for 10sec for an Arduino Mega 2560. I have attached an image of what I tried to do. After I run, it just says no diagnostic. How do I know if I did this correctly or not?
arrow_forward
pls help me to answer this questions
arrow_forward
Please follow the instructions and the requirements according to the pictures above and I kinda need the solution quickly. The language of the code is in Matlab, thank you in advance.
arrow_forward
I am having trouble with the folloiwng MATLAB code. I am getting an error that says "unrecognized function or variable 'numericalPropogatorOptions". I have the aerospace toolbox and the aerospace blockset added. what add on do I have to download to use that function. How do I make this code work?
% Define Keplerian Elements
a = 29599.8; e = 0.0001; i = 0.9774; Omega = 1.3549; w = 0; M = 0.2645;
[RECI, VECI] = Kepler2RV(a, e, i, Omega, w, M);
initialState = [RECI * 1e3; VECI * 1e3]; % Initial position (m) and velocity (m/s)
% Define constants
mu = 3.986004418e14; % Gravitational constant (m^3/s^2)
earthRadius = 6378.1363 * 1e3; % Earth radius in meters
j2 = 1.08263e-3; % J2 perturbation coefficient
% Define propagator options
propOptions = numericalPropagatorOptions('CentralBody', 'Earth', ...
'GravitationalParameter', mu, ...
'InitialState', initialState, ...
'OutputTimeStep', 300); % Output every 300 seconds
% Add perturbations
addGravityModel(propOptions, 'Degree', 2,…
arrow_forward
Suppose your CFD code can handle nonelementary blocks. Combine as many blocks of Fig. as you can. The only restriction is that in any one block, the number of i-intervals and the number of j-intervals must be constants. Show that you can create a structured grid with only three nonelementary blocks. Renumber all the blocks and indicate how many i- and j-intervals are contained in each block. Add up all the cells and verify that the total number of cells does not change.
arrow_forward
Use MATLAB please make code for this.
arrow_forward
I need answer within 20 minutes please please with my best wishes Hussein
arrow_forward
.
arrow_forward
I need help in the following MATLAB code. How do I add the code to answer the following question "Do you find more object detections in the image than the one that is cropped out? Explain how you would discriminate that from a dead pixel, a hot pixel, or a cosmic ray event."
fname = '00095337.fit';
fInfo = fitsinfo(fname);
img = fitsread(fname);
% Crop the image to show just the object:
img_cropped = img(1980:2030,1720:1780);
% Load the labeled image
img_labeled = imread('00095337_labeled_stars.png');
img_labeled = img_labeled(102:863,605:1363,:);
% Get rid of "hot" pixels (cosmic rays, disfunctional pixels)
max_acceptable_value = 1300;
img(img>max_acceptable_value) = max_acceptable_value;
% Plot the images
f1 = figure();
tgroup1 = uitabgroup('Parent',f1);
tab(1) = uitab('Parent', tgroup1, 'Title', 'Raw image');
ax(1) = axes('parent',tab(1));
imagesc(img)
axis equal
axis([0,size(img,2),0,size(img,1)]+0.5)
colormap(gray(256));
xlabel('x [px]')
ylabel('y [px]')…
arrow_forward
HW_5_01P.pdf
PDF
File | C:/Users/Esther/Downloads/HW_5_01P.pdf
2 Would you like to set Microsoft Edge as your default browser?
Set as default
To be most productive with Microsoft Edge, finish setting up your
Complete setup
Maybe later
browser.
(D Page view A Read aloud V Draw
7 Highlight
2
of 3
Erase
5. Two cables are tied to the 2.0 kg ball shown below. The ball revolves in a horizontal
circle at constant speed. (Hint: You will need to use some geometry and properties of
triangles and their angles!)
60°
1.0 m
60°
© 2013 Pearson Education, Inc.
(a) For what speed is the tension the same in both cables?
(b) What is the tension?
2.
2:04 PM
O Type here to search
C A
2/9/2021
(8)
arrow_forward
Help solve this USING MATLAB
arrow_forward
Identify the lines
arrow_forward
Could you please fix my code it’s supposed to look like the graph that’s on the picture. But the lines do not cross eachother at the beginning. Could you make the lines look like the lines on the graph?
Use this code in MATLAB and fix it.
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Define your seed here
seed = 50;
rand('seed',seed); % Set the seed for reproducibility
% Assumed CO2 emissions for Diesel and Petrol
CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel
CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol
% Fit polynomial curves with a reduced degree of 2
pDiesel = polyfit(carPosition, CO2Diesel, 2);
pPetrol = polyfit(carPosition, CO2Petrol, 2);
% Generate points for best fit lines
fitDiesel = polyval(pDiesel, carPosition);
fitPetrol = polyval(pPetrol, carPosition);
% Plotting the data
figure;
hold on;
% Plot Diesel best fit line…
arrow_forward
Please recheck and provide clear and complete step-by-step solution in scanned handwriting or computerized output thank you
arrow_forward
permanent-magnet (pm) genera x
Bb Blackboard Learn
L STAND-ALONE.mp4 - Google Dri x
O Google Drive: ülwgjuó jc lis u
O ME526-WindEnergy-L25-Shuja.p x
O File | C:/Users/Administrator/Desktop/KFUPM%20Term%232/ME526/ME526-WindEnergy-L25-Shuja.pdf
(D Page view
A Read aloud
T) Add text
V Draw
Y Highlight
O Erase
17
of 26
Wind Farms
Consider the arrangement of three wind turbines in the following schematic in which wind
turbine C is in the wakes of turbines A and B.
Given the following:
- Uo = 12 m/s
A
-XẠC = 500 m
-XBC = 200 m
- z = 60 m
- Zo = 0.3 m
U.
-r, = 20 m
B
- CT = 0.88
Compute the total velocity deficit, udef(C) and the velocity at wind turbine C, namely Vc.
Activate Windows
Go to Settings to activate Windows.
Wind Farms (Example Answer)
5:43 PM
A 4)) ENG
5/3/2022
I!
arrow_forward
This code keeps on generating graphs with different curves. The picture that you see two different graphs comes from the same code but both of them have different curves. I need the curve to look like the picture that only has one graph. I basically need the line to have a slight curve and every time I run the code it will come up as the same graph every time. Use this code on MATLAB and fix it
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Use the 'seed' function instead of 'rng'
seed = 50; % Define your seed here
rand('seed',seed);
% Assumed CO2 emissions for Diesel and Petrol
CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel
CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol
% Fit polynomial curves with a reduced degree of 2
pDiesel = polyfit(carPosition, CO2Diesel, 2);
pPetrol = polyfit(carPosition, CO2Petrol, 2);
% Generate points for best fit…
arrow_forward
Hartley Electronics, Inc., in Nashville, producesshort runs of custom airwave scanners for the defense industry.The owner, Janet Hartley, has asked you to reduce inventory byintroducing a kanban system. After several hours of analysis, youdevelop the following data for scanner connectors used in onework cell. How many kanbans do you need for this connector?Daily demand 1,000 connectorsLead time 2 daysSafety stock 12 dayKanban size 500 connectors
arrow_forward
I need a clear answer by hand, not by keyboard and fast answer within 20 minutes. Thank you | dybala
arrow_forward
I need help coding in MATLAB. I have a .txt file containing the following data. That data is saved in a file named data.txt. I am wondering how I could extract all or some of that data into another .m file. Can you show me the code.
[[5.0018696581196584, 17.863820207570207, -13.086858974358975], [5.0018696581196584, 17.863820207570207, -13.086858974358975], [5.0018696581196584, 17.863820207570207, -13.086858974358975]]
arrow_forward
Don't Use Chat GPT Will Upvote And Give Solution In 30 Minutes Please
arrow_forward
Use MATLAB
arrow_forward
Q4: Create a Visual Basic Project to find the value of the following series:
h? h4 h3
cos(h) = h –
2!
3!
4!
Write the code program so that the value of angle (h) is entered into inputbox.
Estimate the value of series (cos(h)) so that the absolute value of any term is
greater or equal to 10-6. Display the required number of terms (N) which it used in
this series in a text box and display the result of series (cos(h)) in another separate
text box.
arrow_forward
4. Documents business requirements use-case narratives.for only one process
note: please i want Documents like this in pic
arrow_forward
How do I input this code for this MATLAB problem? Thanks!
arrow_forward
Look up the Arduino Mega 2560. Document the steps how to work with the Arduino in Matlab and Simulink. Make a simulink program turning on the LED on the board for 10sec. Explain your program, comment on your findings and explain how to test it on the actual hardware.
arrow_forward
Problem 3 (40 points) (CCOs 1 & 3)/MatlabGrader
On Canvas, you will find a Matlab function file process.p that takes as input the variable x and returns as output the result of
a complicated process g (x). Copy the file into your working directory and use it as any other Matlab .m file or build-in intrinsic
Matlab function (just call it using its name process). The only difference between a .p and a .m file is that the source code of the .p
file is not visible.
Find all roots of g(x) in the interval 0 ≤ x ≤ 10 to a tolerance in function of at least 10-10 using mySecant from problem 2.
Recall that any .m or .p function file can be passed as an argument into another function by prefacing the function name by a
@, e.g., @process can be passed as an argument into any Matlab function that uses a function as an input argument, for example
fplot(@process,...) for plotting a function.
Store all found unique roots in a column vector root, the corresponding tolerances in function in a column…
arrow_forward
Matlab coding
arrow_forward
my matrix number is 8 , so choose EVEN matrix numbers side
arrow_forward
MECT361
Mechatronics Components and Instrumentation
PLEASE GIVE ME THE short answer and wite it by keyword
thanks
arrow_forward
I’m making the graph that you see in the picture but the code that I’m using makes the line with to many curves. Could you make the lines look like the one that you see on the graph. Don’t change the color just make it with a little bit less curves like you see in the picture.
Use this code on MATLAB and fix it.
% Sample data for Diesel and Petrol cars
carPosition = linspace(1, 60, 50); % Assumed positions of cars
% Fix the random seed for reproducibility
rng(50);
% Assumed CO2 emissions for Diesel and Petrol
CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel
CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol
% Fit polynomial curves
pDiesel = polyfit(carPosition, CO2Diesel, 3);
pPetrol = polyfit(carPosition, CO2Petrol, 3);
% Generate points for best fit lines
fitDiesel = polyval(pDiesel, carPosition);
fitPetrol = polyval(pPetrol, carPosition);
% Combined best fit
combinedFit = (fitDiesel + fitPetrol) / 2;…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
Related Questions
- The following tools / resources may be useful for you to complete the assignment:a. Chatgpt (You may use it to learn Matlab coding or any other computer language. An example is given here: https://shareg.pt/mXHGne9 ). Please take note that code generated by chatgpt can be directly copied and pasted.b. Matlabi) Useful cheat sheet (https://n.ethz.ch/~marcokre/download/ML-CheatSheet.pdf)ii) Getting started with Matlab (https://matlabacademy.mathworks.com/en/details/gettingstarted )iii) Getting 30-day Matlab trial license (https://www.mathworks.com/campaigns/products/trials.html ) iv) Polyfit (https://www.mathworks.com/help/matlab/ref/polyfit.html )v) Exponential Fit (https://www.mathworks.com/matlabcentral/answers/91159-how-do-i-fit-an-exponential-curve-to-my-data)c. PlotDigitizer (https://plotdigitizer.sourceforge.net/ ) or a free online app that does not requires installation (https://plotdigitizer.com/app )You may use your own engineering judgement to make any assumptions on any…arrow_forwardI need help with simulink. It is my first time using simulink. I am trying to make a simulink program turning on the LED on the board for 10sec for an Arduino Mega 2560. I have attached an image of what I tried to do. After I run, it just says no diagnostic. How do I know if I did this correctly or not?arrow_forwardpls help me to answer this questionsarrow_forward
- Please follow the instructions and the requirements according to the pictures above and I kinda need the solution quickly. The language of the code is in Matlab, thank you in advance.arrow_forwardI am having trouble with the folloiwng MATLAB code. I am getting an error that says "unrecognized function or variable 'numericalPropogatorOptions". I have the aerospace toolbox and the aerospace blockset added. what add on do I have to download to use that function. How do I make this code work? % Define Keplerian Elements a = 29599.8; e = 0.0001; i = 0.9774; Omega = 1.3549; w = 0; M = 0.2645; [RECI, VECI] = Kepler2RV(a, e, i, Omega, w, M); initialState = [RECI * 1e3; VECI * 1e3]; % Initial position (m) and velocity (m/s) % Define constants mu = 3.986004418e14; % Gravitational constant (m^3/s^2) earthRadius = 6378.1363 * 1e3; % Earth radius in meters j2 = 1.08263e-3; % J2 perturbation coefficient % Define propagator options propOptions = numericalPropagatorOptions('CentralBody', 'Earth', ... 'GravitationalParameter', mu, ... 'InitialState', initialState, ... 'OutputTimeStep', 300); % Output every 300 seconds % Add perturbations addGravityModel(propOptions, 'Degree', 2,…arrow_forwardSuppose your CFD code can handle nonelementary blocks. Combine as many blocks of Fig. as you can. The only restriction is that in any one block, the number of i-intervals and the number of j-intervals must be constants. Show that you can create a structured grid with only three nonelementary blocks. Renumber all the blocks and indicate how many i- and j-intervals are contained in each block. Add up all the cells and verify that the total number of cells does not change.arrow_forward
- I need help in the following MATLAB code. How do I add the code to answer the following question "Do you find more object detections in the image than the one that is cropped out? Explain how you would discriminate that from a dead pixel, a hot pixel, or a cosmic ray event." fname = '00095337.fit'; fInfo = fitsinfo(fname); img = fitsread(fname); % Crop the image to show just the object: img_cropped = img(1980:2030,1720:1780); % Load the labeled image img_labeled = imread('00095337_labeled_stars.png'); img_labeled = img_labeled(102:863,605:1363,:); % Get rid of "hot" pixels (cosmic rays, disfunctional pixels) max_acceptable_value = 1300; img(img>max_acceptable_value) = max_acceptable_value; % Plot the images f1 = figure(); tgroup1 = uitabgroup('Parent',f1); tab(1) = uitab('Parent', tgroup1, 'Title', 'Raw image'); ax(1) = axes('parent',tab(1)); imagesc(img) axis equal axis([0,size(img,2),0,size(img,1)]+0.5) colormap(gray(256)); xlabel('x [px]') ylabel('y [px]')…arrow_forwardHW_5_01P.pdf PDF File | C:/Users/Esther/Downloads/HW_5_01P.pdf 2 Would you like to set Microsoft Edge as your default browser? Set as default To be most productive with Microsoft Edge, finish setting up your Complete setup Maybe later browser. (D Page view A Read aloud V Draw 7 Highlight 2 of 3 Erase 5. Two cables are tied to the 2.0 kg ball shown below. The ball revolves in a horizontal circle at constant speed. (Hint: You will need to use some geometry and properties of triangles and their angles!) 60° 1.0 m 60° © 2013 Pearson Education, Inc. (a) For what speed is the tension the same in both cables? (b) What is the tension? 2. 2:04 PM O Type here to search C A 2/9/2021 (8)arrow_forwardHelp solve this USING MATLABarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY