Introduction To Matlab Class 7

Slides:



Advertisements
Similar presentations
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Advertisements

Matlab Intro Simple introduction to some basic Matlab syntax. Declaration of a variable [ ] Matrices or vectors Some special (useful) syntax. Control statements.
Matlab Class 5 Xiaotao Su, Ph.D. Visual Psychophysicist & IT Group Leader Rutgers Center for Cognitive Science (RuCCS)
Introduction to Matlab
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 10.
Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
Introduction to Excel Formulas, Functions and References.
The TI-83 Plus Elementary Algebra Calculator Tutorial.
Click your mouse for next slide Dreamweaver – Merging, Coloring, Fonts Now it’s time to fill your page with some more interesting stuff The first thing.
Right-click on the colored box and remove it.
1 Flash Actionscript Adding Interactive Actions. 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether.
Fundamentals of matrices
Mastering Your Word Processing Skills
Matlab Class 7 Hristiyan Kourtev & Xiaotao Su, Ph.D. Visual Psychophysicist & IT Group Leader Rutgers Center for Cognitive Science (RuCCS)
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
2 pt 3 pt 4 pt 5pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2pt 3 pt 4pt 5 pt 1pt 2pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4pt 5 pt 1pt Word- processing The Rest of the.
Motors and Sound Troubleshooting Tips. © H-CCS Problem 1 Why can’t I download my program to the RCX?
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
Introduction To Matlab Class 9 Instructors: Hristiyan (Chris) Kourtev and Xiaotao Su, PhD.
Introduction To Matlab Class 4 Instructors: Hristiyan (Chris) Kourtev and Xiaotao Su, PhD Double click the matlab icon When prompted click “Skip”
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
Unit 7.4 Introduction to modelling & presenting numeric data Lesson 1 Setting up a basic spreadsheet.
SCRIPTS AND FUNCTIONS DAVID COOPER SUMMER Extensions MATLAB has two main extension types.m for functions and scripts and.mat for variable save files.
Matlab Class 4 Xiaotao Su, Ph.D. Visual Psychophysicist & IT Group Leader Rutgers Center for Cognitive Science (RuCCS) and Chris Kourtev.
Introduction To Matlab Class 5 Instructors: Hristiyan (Chris) Kourtev and Xiaotao Su, PhD.
BCI2000: 2D Control. Getting Started Follow the Passive Stimulus Presentation Data Collection Tutorial on the wiki – However, when the tutorial tells.
Matlab Class 6 Xiaotao Su, Ph.D. Visual Psychophysicist & IT Group Leader Rutgers Center for Cognitive Science (RuCCS) and Chris Kourtev.
Matlab Class 8 Xiaotao Su, Ph.D. Visual Psychophysicist & IT Group Leader Rutgers Center for Cognitive Science (RuCCS) and Chris Kourtev.
Get to work in Excel Lesson 2 By the end of this lesson you will be able to complete the following: Find everyday commands on the Ribbon such as Cut, Copy,
A rectangular array of numeric or algebraic quantities subject to mathematical operations. The regular formation of elements into columns and rows.
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
Microsoft ® Office Word 2010 Introduction Creating your First Basic Document.
Unit 5: Canvas Painter.
ECE 1304 Introduction to Electrical and Computer Engineering
13.4 Product of Two Matrices
Introduction To Matlab Class 3
Prof. Mark Glauser Created by: David Marr
Signals in Matlab Matlab as a name stands for Matrix Laboratory.
Introduction to Matlab
Lecture: MATLAB Chapter 1 Introduction
Matlab Class 2 Xiaotao Su, Ph. D
Introduction to Matlab
Click here for the answer. Click here for the answer.
Click here for the answer. Click here for the answer.
Using the INSERT TAB in MS Word 2007
Click here for the answer. Click here for the answer.
Introduction To Matlab Class 2
Matlab Workshop 9/22/2018.
Introduction To Matlab Class 1
Matlab Class 6 Xiaotao Su, Ph. D
StatLab Matlab Workshop
MATH 493 Introduction to MATLAB
Binary Search Example with Labeled Indices
Name: _______________________________
StatLab Workshop: Intro to Matlab for Data Analysis and Statistical Modeling 11/29/2018.
Introduction To Matlab Class 9
Go to =>
Splash Screen.
Introduction to MATLAB
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Stata Basic Course Lab 2.
Buttons & Boards CSE 120 Winter 2019
Matrix A matrix is a rectangular arrangement of numbers in rows and columns Each number in a matrix is called an Element. The dimensions of a matrix are.
Arrays in MatLab Arrays can have any number dimensions
MATLAB (Lecture 2) BY:MAHA ALMOUSA.
Introduction to Matrices
By Yu-Chen Hsiao Chun-Ti Su
(Type Answer Here) (Type Answer Here) (Type Answer Here)
Presentation transcript:

Introduction To Matlab Class 7 Instructors: Hristiyan (Chris) Kourtev and Xiaotao Su, PhD

cell arrays ‘cat’ 3 ‘zebra’ ‘dog’ 5 9 10 3 9 5 cell arrays are a different data type they are like a matrix where each element is any other data type example_cell_array = {‘cat’, 3, [5, 9]; ‘zebra’, [10, 3; 9, 5], ‘dog’}; ‘cat’ 3 ‘zebra’ ‘dog’ 5 9 10 3 9 5

‘cat’ 3 ‘zebra’ ‘dog’ 5 9 10 3 9 5 a = example_cell_array{2, 3} example_cell_array{2, 1} = a example_cell_array{2, 2}(2, 1)

cell2csv Works just like csvwrite Will only work with “simple” cell arrays no numeric vectors or matrices data = {‘trial number’, ‘time’, ‘color’, ‘response’; 1, 5.99, ‘blue’, 3; 2, 4, ‘green’, 2; 3, 55, ‘yellow’, 2} cell2csv(‘somefile.csv’, data); !Note: cell2csv is not a built in Matlab function. Download it here: http://ruccs.rutgers.edu/matlab_course/materials/class_7/cell2csv.m

important note to add one data element to a cell array data{5, 3} = 'yellow’ curly braces To add one row of data data(5, :) = {4, 2.93, ‘yellow’, 4} parenthesis data(trial+1, :) = {trial, time, color, response}

response = input('What is it?'); stop_time = GetSecs; response_time = stop_time - start_time; is_correct = (response==random_num); if(is_correct) disp('Right!'); else disp(['Wrong! The correct answer was ', ... num2str(random_num)]); end disp('Press any key to continue'); pause disp('--------'); %record data guessing_game_data(t, :) =... [t, response_time, response, ... random_num, is_correct ]; %guessing_game.m %test to see if subject is psychic clear all; %settings num_trials = 5; highest_number = 3; %get info subject_name = input('What is your name?', 's'); for t = 1:num_trials %trial set up random_num = ceil(rand*highest_number); %perform experiment start_time = GetSecs; disp('I am thinking of a number between'); disp([' 1 and ', num2str(highest_number)]); %data_storage csvwrite([subject_name, '.csv'], … guessing_game_data);

response = input('What is it?'); stop_time = GetSecs; response_time = stop_time - start_time; is_correct = (response==random_num); if(is_correct) disp('Right!'); else disp(['Wrong! The correct answer was ', ... num2str(random_num)]); end disp('Press any key to continue'); pause disp('--------'); %record data guessing_game_data(t, :) =... [t, response_time, response, ... random_num, is_correct ]; %guessing_game.m %test to see if subject is psychic clear all; %settings num_trials = 5; highest_number = 3; %get info subject_name = input('What is your name?', 's'); for t = 1:num_trials %trial set up random_num = ceil(rand*highest_number); %perform experiment start_time = GetSecs; disp('I am thinking of a number between'); disp([' 1 and ', num2str(highest_number)]); %set up labels guessing_game_data = {‘trial’, ‘response time’, … ‘response’, ‘random_num’, ‘is_correct?’} %record data guessing_game_data(t+1, :) = … {t, response_time, response, random_num, is_correct} %data_storage csvwrite([subject_name, '.csv'], … guessing_game_data); cell2csv

Task - color differentiation (part 1) Take subject name screen_setup trial loop (start with 5) color = [rand*255, rand*255, rand*255] put circles 1-4 on the screen one of the four circles will be slightly off (start with +/-50), color from the others on one of the three color dimensions (randomly chose dimension); careful that your deviation doesn’t go >255 or <0 The subject will click on the circle they feel is different record data (whatever would be useful) if the subject was right in the last loop, the amount the color is off is cut in half, otherwise, increase by half save trial data to csv tip: make a function to determine if the cursor is in a shape function is_in = in_shape(vect, mouse_x, mouse_y)

Task - color differentiation (part 2) Further additions: allow the subject to press 1 - 4 to select a circle (using KbCheck) put numbers in the circles Hint: You need to use the following commands: Screen('TextFont', window, fontName*); Screen('TextSize', window, fontSize**); Screen('DrawText', window, textString, x, y, textColor); *fontName can be “Arial”, “Verdana” or other *fontSize can be any number. Start with around 20 and adjust as needed