How to track numbers in the MATLAB excel sheet?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Justin
le 2 Mai 2014
Modifié(e) : Justin
le 2 Mai 2014
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 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!