Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Matlab Problems! home / study / engineering / computer science / questions and a

ID: 3822284 • Letter: M

Question

Matlab Problems!

home / study / engineering / computer science / questions and answers / matlab , the language which i am using to solve ...

Question: Matlab , the language which I am using to solve th...

Bookmark

Matlab , the language which I am using to solve this problem is MATLAB.

This project requires you to create a program that takes two inputs:

o Astringofanylength.

o A number of words per minute.

Your program will take the string, break it up into individual words, and display it one word at a time at the desired rate. For instance, “Hello World!” at 500 words per minute would display “Hello” for 3/25ths of a second and then “World!” for 3/25ths of a second. You’ll be surprised to discover that you can read words that are displayed quite quickly!

Your project needs to have a graphical interface that will let a user input a string, select a rate, and press a button to display the words of that string at the desired rate.

Explanation / Answer

% I don't have matlab software to create the GUI part, I am currently using online editors. I implemented the same with console I/O.

%Anyways, I have completed all the functions, all you have to is plug in the UI dialog and get input, then pass it to the below function. I am sure, you will atleast get idea of how to do it, if you see the below code.


function delayedDisplay(str, wordsPerMin)
    delayTime = 60/wordsPerMin;
    listOfWords = strsplit(str);
  
    for i=1:length(listOfWords)
        pause(delayTime);
        fprintf("%s ",listOfWords{i});
    end
    fprintf(" ");
end


speed = input("Enter the speed (Words/Min) : ");
str = input("Enter the string : ",'s');
delayedDisplay(str, speed);