MATLAB note [ing]

Source: Internet
Author: User

1. histogram Rendering

Matrix = yours;

H = Hist (matrix (:), 256 );
Horz = min (matrix (:)) :( max (matrix (:))-min (matrix (:))/255: max (matrix (:));

Bar (horz, H );

Draw the Laplace Distribution and Gaussian distribution:

X =-10:0. 05:10;

Y = 1/SQRT (2)/1 * exp (-SQRT (2)/1 * ABS (x); % Laplace

Y2 = 1/SQRT (2 * PI) * exp (-X. * X/2); % Gaussian

Plot (x, y );

Plot (x, Y2 );

First obtain the Laplace Distribution chart:

Then, we obtain the Gaussian distribution chart:



2. re-arrange the vectors into an image (note that the Left mentioned below actually retrieves data from each column in the right column, which may be different from the memory mode in other languages)

We know that this code will generate a vector: (right is 512*512 matrix)

Left = right (:);

So how can we convert left into two-dimensional image output?

Experiment:

Tmptry = right; % Give tmptry a template to let him know at least what kind of profile he should look like

Tmptry (:) = left;

Imshow (tmptry, []); % congratulations! You are good man!

I didn't expect it to succeed. MATLAB is really so powerful, haha.

However, such Code cannot be successful (OPPs !) :

Tmptry [];

For xi = 1: 1: size (right, 1)
Tmptry = [tmptry; left (XI: size (right, 1): End)];
End


MATLAB note [ing]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.