How to code for Barchart and mean in matlab
5 ビュー (過去 30 日間)
古いコメントを表示
Siddharth Satishchandran
2021 年 6 月 19 日
コメント済み: Siddharth Satishchandran
2021 年 6 月 20 日
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 件のコメント
採用された回答
Sulaymon Eshkabilov
2021 年 6 月 19 日
編集済み: Sulaymon Eshkabilov
2021 年 6 月 19 日
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 件のコメント
その他の回答 (6 件)
Siddharth Satishchandran
2021 年 6 月 19 日
編集済み: Image Analyst
2021 年 6 月 19 日
2 件のコメント
Image Analyst
2021 年 6 月 19 日
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
2021 年 6 月 19 日
Error in your command syntax:
load('/Users/ameliachang/Downloads/LabelTable.mat') % one ) has to be removed.
Sulaymon Eshkabilov
2021 年 6 月 19 日
load('C:\Users\siddharthsatish\Downloads\LabelTable.mat') % Fix directory: C:\ or D:\
2 件のコメント
Sulaymon Eshkabilov
2021 年 6 月 19 日
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 件のコメント
Sulaymon Eshkabilov
2021 年 6 月 19 日
cd ~/home/mluser/siddharthsatish/'Downloads' % Watch where apostrophe signs ' ' are placed
4 件のコメント
Sulaymon Eshkabilov
2021 年 6 月 20 日
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')
参考
カテゴリ
Help Center および File Exchange で Performance and Memory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
