Write this code in MATLAB.

조회 수: 96 (최근 30일)
vmnf kfnk
vmnf kfnk 2020년 4월 10일
댓글: Abdulrahman Farouq 2022년 1월 18일
Write this code in MATLAB.
1. As of early 2018, Usain Bolt holds the world record in the men's 100-meter dash. It is 9.58 seconds. What was his average speed in km/h? Assign the result to a variable called hundred.
2. Kenyan Eliud Kipchoge set a new world record for men of 2:01:39 on September 16, 2018. Assign his average speed in km/h to the variable marathon. The marathon distance is 42.195 kilometers.
Expert Answer
  댓글 수: 14
Ashish Kumar
Ashish Kumar 2021년 1월 15일
%Converting distance in kilometers
distance1 = 100/1000;
%Converting time in hours
time1 = 9.58/3600;
%Calculating speed
hundred = distance1 / time1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
distance2 = 42.195;
%Calculating and Converting time in hours
time2 = (121*60+39)/3600;
%Calculating speed
marathon = distance2 / time2
Abdulrahman  Farouq
Abdulrahman Farouq 2022년 1월 18일
Thx so much

댓글을 달려면 로그인하십시오.

채택된 답변

vmnf kfnk
vmnf kfnk 2020년 4월 27일
y=0.1/9.58;
hundred=y*3600
x=42.195/((121*60)+39);
marathon=x*3600
  댓글 수: 3
Rik
Rik 2020년 5월 11일
편집: Rik 2020년 5월 11일
I guess because 100 meter is 0.1 kilometer, but this is the problem with undocumented code.
Edit: the original comment by Priya Dwivedi was "Y u took 0.1 in the above calculation?"
Walter Roberson
Walter Roberson 2020년 5월 11일
The link to learningtool does not go anywhere useful. I am not sure that we as outside people would be able to see a student solution anyhow.

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Gokul Krishnan
Gokul Krishnan 2020년 9월 8일
편집: Walter Roberson 2020년 9월 8일
y=0.1/9.58;
hundred=y*3600
x=42.195/((121*60)+39);
marathon=x*3600

Abhiram K Narayanan
Abhiram K Narayanan 2020년 11월 20일
us_dist = 0.1
us_time = (9.58/3600)
hundred = us_dist/us_time
ken_dis = 42.195
ken_time = 2.0275
marathon = ken_dis/ken_time

Haya Aldawsari
Haya Aldawsari 2021년 5월 23일
%Usain
time1 = (9.58/60)/60
distance1 = 100/1000
hundred = distance1/time1
%Kenyan
time2 = 2 + (1/60) + (39/3600)
distance2 = 42.195
marathon = distance2 / time2
  댓글 수: 6
Rik
Rik 2021년 5월 25일
Posting duplicate solutions is perfectly common for Cody, but here the goal should (in my view) be to have different solutions.
I absolutely don't want to kill your enjoyment. Maybe you are the next Walter Roberson. I just want every answer to actually add something. Why encourage cheating? I'm just one person, so it is not feasible for me to spend all my time deleting duplicate answers. I do delete a lot of them, but answering new questions is much more fun.
I hope you will join 'us' in answering non-homework questions. It is a lot of fun and you can learn a lot. Some people have been programming Matlab since around the time I was born and reading their solutions is quite an education.
Given this discussion I don't think this answer should be deleted anymore, but not due to the answer itself. I hope you understand my intentions.
Haya Aldawsari
Haya Aldawsari 2021년 5월 29일
Thank you so much for your advice
Now I understand your point and you are right
I will definitely try my best to answer non-homework questions and learn from others' answers.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Platform and License에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by