Display the instructions in the command window

Assignment Help Other Subject
Reference no: EM133135114

This script will run a free-association exercise that works as follows: A series of words is presented, and after each presented word the subject responds as quickly as possible by typing the first word that comes to mind.

Begin your script with the following:

• Opening comments.
• Clear the variables from the workspace.
• Clear the command window.
• Shuffle the random number generator.

In the PREPARE WORD-PROMPTS section:

• Import the provided csv file (free association word list.csv) into a table called wordTable. There will be two columns in the table: Word (a list of words) and IsAdjective (0 indicating the given word is not an adjective, or 1 indicating the given word is an adjective).

• Define numPrompts as 10, representing the number of word-prompts that will be used in the exercise. DO NOT HARD-CODE THE NUMBER 10 ANYWHERE ELSE IN THE PROGRAM.

• Define prompts as either a 2 x 5 string array or a 2 x 5 cell array of character vectors. Row 1 should contain 5 randomly selected non-adjectives from the table in a random order, and row 2 should contain 5 randomly selected adjectives from the table. Instead of hard-coding the number 5, use numPrompts/2 so your program will still work if other even values of numPrompts are used. IMPORTANT: Make sure the selected words are randomly selected from the list; don't just choose the fist 5 of each type; every word in the list should have a chance of being selected. If you wish, before randomly selecting the words, you may extract all the words from the table into two vectors (a vector of all the non-adjectives and a vector of all the adjectives).

In the FREE-ASSOCIATION EXERCISE section:

• Initialize a cell column-vector called responses to hold the subject's responses.

• Initialize a numeric column-vector (using NaN values) called responseSecs to hold the subject's response times (i.e., the number of seconds the subject takes to complete each response).

• Display the following instructions in the command window:

EXERCISE

After each presented word, type the first word that comes to mind in response.
Type your answer as quickly as possible without thinking about it, and then press Return. Press any key to begin.
• Use a for-loop to present the words in the prompts matrix one at a time, collecting a response to each. Alternate between non-adjectives and adjectives (i.e., the first word should be a non-adjective,
the second word should be an adjective, the third word should be a non-adjective, the fourth word should be an adjective, and so on). HINT: Use linear indexing to efficiently alternate between rows of the prompts matrix.

• Clear the command window before presenting each prompt.

• Put a line-break at the end of each prompt to ensure that the user's response is typed on the line below the prompt.

• For each prompt, if the response is empty (i.e., if the user just presses Return without entering anything), repeat the same prompt until a nonempty response is given.

• For each prompt, if the response is ‘abort exercise' (with any capitalization), print Exercise aborted. in the command window, and end the program immediately.

• Record the number of seconds it takes the subject to complete their response to each prompt. If you're using Matlab remotely, the response time might not be recorded correctly, due to lags in the registering of key-presses.

In the REPORT section:

• Define resultsTable as a table with the following 3 columns: Prompt (the prompts in the order they were presented), Response (the corresponding responses to the prompts), Seconds (the corresponding response times in seconds).

• Clear the command window, and then display resultTable in the command window using the disp function.

• Below the table, print
Exercise complete!
in the command window.

In the SAVE section:

• Save prompts, responses, and responseSecs to a file called psych20ahw5data.mat

• Export resultsTable to a file called psych20ahw5results.csv

Attachment:- Matlab script.rar

Reference no: EM133135114

Questions Cloud

Create all journal entries to record the pension expense : The pension fund paid out benefits in each year. Create all journal entries to record the pension expense and the company's pension plan funding for both years
Define the term forced ranking : What are the advantages and disadvantages of using a 'forced ranking' performance management process?Formulate an opinion and support it with properly cited sou
Witnessed moral hazard in the workplace : Give examples from your employment history where you witnessed moral hazard in the workplace. What were the incentives that gave rise to moral hazard?
Describe second artifact : 1. Using your reading notes for reference, describe your first artifact ("The Man to Send Rain Clouds").
Display the instructions in the command window : Display the instructions in the command window - Initialize a numeric column-vector (using NaN values) called responseSecs to hold the subject's response times
High quality and productivity in the organization : Give a reflection on the concept of ensuring high quality and productivity in the organization.
Shattering the glass ceiling can take : Identify two strategies organizations that are committed to shattering the glass ceiling can take. Support your response with research and specific examples.
Organizational planning and human resource planning : 1. List down and briefly discuss any five (5) aims / benefits of strategic human resource management to an organization (G1)
What is your npw for option a : Initial purchase price of $8340, annual cost for equipment replacement of $2215, What is your NPW for Option A

Reviews

Write a Review

Other Subject Questions & Answers

  Discuss one obstacle that teachers may encounter

Identify and describe at least two resources that teachers can utilize in their planning and implementation. These can be text or web-based resources.

  Project orientation and initial planning

What are some of the problems that exist in criminal justice today? How can these problems be crafted into a topic for your capstone project?

  Nervous-system-based theory of temperament

What is the "Human Genome Project"? How is it different from the eugenics movement? How is it similar? In your post, describe the relevant history. What do you think are the important ethical concerns related to each of these?

  Discuss models of organizational power

In this week's discussion question, you are asked to examine strategies, theories, and models of organizational power and influence in order to understand.

  How would kants idea of what give an act moral worth apply

Discuss which school of thought would most approve of your course of action. How would Kant's idea of what give an act moral worth apply?

  Relationship between foster care and becoming homeless

How are the needs of homeless youth similar to the needs of other homeless populations? In what ways are they different? Discuss the relationship between foster care (and aging out of foster care) and becoming homeless.

  What does a biophysical profile include

What does a Biophysical Profile (BPP) include? What are the five indicators that are assessed with a BPP? When is this test indicated? With references.

  What are some possible strategies for creating more progress

The report notes that progress in reducing extreme hunger is uneven across regions of the world. Looking at the graph on page 21 of the report, which regions.

  Hypothetical university

At a hypothetical university, the plot of first and second year GPAs is football shaped and the correlation is 0.5. What percentile would you predict for the second year GPA of a student whose first year GPA is at the 89th percentile?

  Issue the higher education of chinese and american how to

issue the higher education of chinese and american how to learn each other?please use four sources i will give you four

  Introduce and note why the topic is important

Write a paper between 10 and 15 pages in length; the topic is Obergfell v. Hodges, it will also need to be focused around the supreme court decision.

  Describe the strategies for conflict resolution

Describe the strategies for conflict resolution and how you would collaborate with a nurse leader to resolve the conflict

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd