1. Write a script that will print the following multiplication table. (30 points
ID: 2250030 • Letter: 1
Question
1. Write a script that will print the following multiplication table. (30 points) 2 LA 9 8 10 12 15 16 25 16 20 2. Long distance swimmers desire to find out their average speed based on their estimated completion time for a 4-mile swimming distance (The world record is about 1 hour 30 minutes). Write a function called SwimmingRecord that will accept a vector of different wimmers' target completion times in whole number of minutes. The function returns a vector of the average speed in mile per hour for each completion time and prints the average speed (in mile per hour) for each swimmer. Call your function for a vector argument of at least five different completion times and assign the returned value to a variable called AverageSpeed. Your function should do error check for non-whole and negative numbers (30 points)Explanation / Answer
Matlab Script:
clc
clear all
close all
N = 5;
for i = 1:N
%if(i>1)
for k = 1:i-1
fprintf(" ");
end
%end
for j = i:N;
fprintf("%2d ",i*j);
end
fprintf(" ");
end
Output:
>>
1 2 3 4 5
4 6 8 10
9 12 15
16 20
25
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.