How to track numbers in the MATLAB excel sheet?
2 ビュー (過去 30 日間)
古いコメントを表示
I asked a function to run which produces a lot of numbers which I then can see in the MATLAB excel sheet. Is there a way to find out how many times a certain number showed up in the excel sheet or have it highlight every one of a certain number?
thanks.
0 件のコメント
回答 (1 件)
Justin
2014 年 5 月 2 日
編集済み: Justin
2014 年 5 月 2 日
I believe the correct name for what you are referring to as the Matlab excel sheet is called the Variable Editor.
A simple answer to your question would be to take a sum of all values in the array equal to the number you are interested in.
For example:
% define your array
x = [1 2 3 4 3 4 3 2 1 3];
% x == 3 will make a logical array where there will be a one for every value that is equal to 3
isValue = x == 3;
% sum will add up all the values in the logical array giving you a count of how many number threes there are
count = sum(isValue(:))
I would definitely recommend going to this site http://www.mathworks.com/academia/student_center/tutorials/launchpad.html and doing the Getting Started with MATLAB tutorial. Also take a look at http://www.mathworks.com/products/matlab/examples.html.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!