Display the following in the command window
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi, so I need to get the following command, I tried the following but i am not sure if I am correct or not? This is how it should look: (in a matrix way)[Importing Data from Excel "The response times on the four tests of all the participants are:"
"ParticipantID " "Test1" "Test2" "Test3" "Test4"
(201.0000 0.8900 0.9200 0.6700 0.7800)
(202.0000 0.7500 0.7600 0.6600 0.6000)
(203.0000 1.0200 1.0700 0.8600 0.7800)
(204.0000 0.9800 0.9800 0.6000 0.5700)
(206.0000 0.6800 0.7000 0.6700 0.8900)
207.0000 1.2300 1.1000 0.7800 0.5900
208.0000 0.4500 0.5000 0.5100 0.6700
209.0000 1.5700 1.5800 0.5000 0.7800
210.0000 0.9700 1.0100 0.6700 0.8000
I tried:
input('the response time on the four tests of all the participants are:')
disp(' Paricipant ID Test1 Test2 Test3 Test4')
Data=xlsread('responsetime.xls')
average=mean(data)
fprintf('the average value is: %3 f\n', average)
so now what I got is not really a nice looking data, secondly, when I command the mean, it calculated everything even the Participants ID! All what I need is to calculate the average of the tests (1-4)
my other question is how to make a command to get the average for only (test 3 and Test4) and how can I get it in this format:
The average response time for Tests 1, 2, 3 and 4 are:
0.9489 0.9578 0.6578 0.7178
and like this too:
The average response time of each participant on visual search tests are:
201.0000 0.9050
202.0000 0.7550
203.0000 1.0450
204.0000 0.9800
206.0000 0.6900
207.0000 1.1650
208.0000 0.4750
209.0000 1.5750
210.0000 0.9900
and how to command the data in "ascending, descending orders and fastest"
I am so confused! Also if anyone can suggest a good book for mastering MATLAB!
Many Many Thanks!
1 Comment
per isakson
on 10 Feb 2015
If you have a fairly new release of Matlab you might want to check out table, Create table from workspace variables
Answers (1)
per isakson
on 10 Feb 2015
Edited: per isakson
on 10 Feb 2015
Replace
average=mean(data)
by
average = mean( data(:,2:end), 2 )
to avoid the Participants ID and average over the rows, not columns
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!