No video

Matlab Basics: Histograms

  Рет қаралды 50,865

CodingLikeMad

CodingLikeMad

Күн бұрын

Пікірлер: 15
@yesitasnow
@yesitasnow 5 жыл бұрын
Hello! Thanks for the video, I was looking for a way to obtain the values of the histogram and I just couldn't find them until I saw this video. Thanks! I needed the values to do other things. What I did was: 1. I created a random vector (just to see if the code worked) 2. I calculated the histogram and saved it in a variable "h" 3. I took the values with that command and saved them in another vector and now they are available for use Be careful with the capital V in values ;) prueba=rand(10000,1); h=histogram(prueba,256); h2=h.Values;
@andreeapetronelabalasca7212
@andreeapetronelabalasca7212 5 жыл бұрын
Amazing explanation!!
@dellonerf3140
@dellonerf3140 4 жыл бұрын
Hello, great video it helped a lot. But i have one question, i currently count how many times a letter appears in a text and try to visualize the number they appear in a histogram. But how can i rename the x axis that each bar of the histogram is assigned to a letter?
@CodingLikeMad
@CodingLikeMad 4 жыл бұрын
Hi dello, I would suggest looking at the documentation for histogram: www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.histogram.html What you want to do is plot Categorical data. The right way to do this is shown in an example ("Plot Categorical Histogram"), where you provide the data as a categorical. In your case, each letter would be a different category. I think you can basically just convert the text corpus letter by letter to categorical and it will do the rest for you :)
@banumathik.l375
@banumathik.l375 3 жыл бұрын
Hello good evening, Please let me know how to calculate standard deviation, arithmetic mean and variance of an image
@CodingLikeMad
@CodingLikeMad 3 жыл бұрын
Images are basically arrays, so you do it the same way you would any array. You just need to figure out how you want to deal with the 3 color channels.
@KayIgwe
@KayIgwe 5 жыл бұрын
I get the following error when I use histogram(X, 'BinWidth', 7): Invalid or deleted object. here is an example running the same code you presented in the video: >> myHist.morebins(); Invalid or deleted object. Error in matlab.graphics.chart.primitive.Histogram/morebins What am I doing wrong? I am running this in Matlab 2017b
@CodingLikeMad
@CodingLikeMad 5 жыл бұрын
The most common way to see this error is if you close the figure window which had the histogram in it. If you keep it open while you adjust the bin count it should just dynamically update the figure. Let me know if it still doesn't work, and thanks for asking :)
@KayIgwe
@KayIgwe 5 жыл бұрын
@@CodingLikeMad Is there any way to then plot the log of the histogram? I read in various places that the only way to do this would be to use the hist function, but I saw that that function is being decommissioned. Nevermind, I got it... set(gca, 'Yscale', 'log')
@CodingLikeMad
@CodingLikeMad 5 жыл бұрын
Correct, I was just about to reply! You can set it back with set(gca, 'Yscale', 'linear'), and also use the normal yticks and ylabels to make the spacing to be powers of 10.
@KayIgwe
@KayIgwe 5 жыл бұрын
@@CodingLikeMad Hopefully this is the last question, but is there a way to save the log data? even after the graph has been closed, so that I can send the log transformed histogram, data, into a function?
@CodingLikeMad
@CodingLikeMad 5 жыл бұрын
I don't know of a perfect way to do what you want, but it depends on exactly what you mean. So you can save the bin values (which will not be in log space), and then use a log10() on them to move them to log space if you want (or just save the values and do what you want with them). This won't save the histogram itself, but you can get the bin values and their positions which let you do most things you might want. Now it IS possible to save a histogram and restore it, but I don't think you want to do this. It took me some work to figure out, but if you save the FIGURE the histogram is plotted in, and then reload the figure, you can get the original histogram from the Children variable inside the figure. But this is really not the right way to do this. I'm pretty sure you can do everything you want from the bin values.
@juandiegorodriguezavila8961
@juandiegorodriguezavila8961 3 жыл бұрын
whats r-x?
Matlab Tutorial: Introduction to Logical Indexing
3:24
CodingLikeMad
Рет қаралды 2,1 М.
What Do These Histograms Tell You? The Answers
6:09
SPC for Excel Software
Рет қаралды 9 М.
2D Plotting in Matlab
25:08
Christopher Lum
Рет қаралды 167 М.
Lesson 1.7: Introduction to Plotting in MATLAB
19:07
Fitzle LLC
Рет қаралды 142 М.
Why you should not be a data scientist
12:33
Tina Huang
Рет қаралды 759 М.
Matplotlib Tutorial (Part 6): Histograms
16:36
Corey Schafer
Рет қаралды 185 М.
Research Quality Plot in MATLAB from EXCEL Data
18:31
Anirban Bose
Рет қаралды 88 М.
Cross-Correlation for Particle Image Velocimetry (PIV) using MATLAB
20:54
Statistics in MATLAB | All You Need To Know
12:21
Laplace Academy
Рет қаралды 504
3D Plotting in Matlab
34:58
Christopher Lum
Рет қаралды 238 М.
Reading Video Files With Matlab For Image Processing
12:44
CodingLikeMad
Рет қаралды 16 М.