How to code for Barchart and mean in matlab
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Siddharth Satishchandran
am 19 Jun. 2021
Kommentiert: Siddharth Satishchandran
am 20 Jun. 2021
I am using Matlab for the first time. I have used R before but Im new to Matlab. The new lab Im in wants me to use more Matlab in place of R programming for the next project. Im working on primate vocalizations. We have data that we have collected over months for a number of individuals. Im tryin to create a script that calculates mean call rate for just the first three animals in the dataset (no. of vocalizations/minute) and i'm trying to create a bar chart showing the call rate of each animal. It would be great If I could get some help so I can get started on working with the larger datasets for the lab. I have attched the the extracted dataset that I am using as a sample to make the barchart and the calculate the mean. I think for the mean calculation, I have to use the audio stop and start columns.
0 Kommentare
Akzeptierte Antwort
Sulaymon Eshkabilov
am 19 Jun. 2021
Bearbeitet: Sulaymon Eshkabilov
am 19 Jun. 2021
Simply to use bar():
DD = readtable('Data extracted- Lab.xls');
DD = readtable('Data extracted- Lab.xls');
Mean_A =DD.AudioStartTime;
Mean_V =DD.VideoStart;
figure
bar(DD.AudioStartTime)
figure
bar(DD.VideoStart)
...
2 Kommentare
Weitere Antworten (6)
Siddharth Satishchandran
am 19 Jun. 2021
Bearbeitet: Image Analyst
am 19 Jun. 2021
2 Kommentare
Image Analyst
am 19 Jun. 2021
The file you uploaded had only 3 lines of data - not enough to get averages for all those call types and categories. Please upload an actual file with lots of data in it.
Sulaymon Eshkabilov
am 19 Jun. 2021
Error in your command syntax:
load('/Users/ameliachang/Downloads/LabelTable.mat') % one ) has to be removed.
Sulaymon Eshkabilov
am 19 Jun. 2021
load('C:\Users\siddharthsatish\Downloads\LabelTable.mat') % Fix directory: C:\ or D:\
2 Kommentare
Sulaymon Eshkabilov
am 19 Jun. 2021
Ok. Well Mac has a different syntax for directory specs.
In that case, you can change the directory and then load the data file. Try this:
cd ~/ameliachang/'Downloads'
You may also try using "Finder" to find the folder, right-click on it, and then click "Get Info".
3 Kommentare
Sulaymon Eshkabilov
am 19 Jun. 2021
cd ~/home/mluser/siddharthsatish/'Downloads' % Watch where apostrophe signs ' ' are placed
4 Kommentare
Sulaymon Eshkabilov
am 20 Jun. 2021
Just put your *.mat file into your MATLAB directory, then you can load all your data with one simple command, e.g.:
load('LabelTable.mat')
Siehe auch
Kategorien
Mehr zu Performance and Memory finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
