Matlab Learning (a): Digital image processing functions used in large jobs

Source: Internet
Author: User

1.dlmread--reads ASCII-delimited numeric data into the matrix

DT = Dlmread ('data1.txt',',1,0= DT (:, 1 Save ('data2.txt','dt','  -ascii');

2.mean

Mean (a)% for the mean     value of each row mean (A,2)% to find the mean of each column

3.min/max

*dim=1 returns the row vector, the maximum value per column

dim=2 returns the column vector, the maximum value per row

4.round rounded rounding (rounded to the nearest integer)

5.struct

struct ('field1', values1,'field2 '

This is the assignment when the struct is built, and Values1,values2 is the value assigned to FIELD1,FIELD2. Field1,field2 is the domain name.

* "true" or "false" to create a logical array directly

6.nargin determine the number of input parameters

7.norm

1, if A is a matrix n=Norm (a) returns the maximum singular value of a, i.e. Max (SVD (a)) n=Norm (a,p), depending on p, returns a different value P1returns the largest column in a and, that is, max (Sum search (ABS (A)))2Returns the maximum singular value of a, and n=Norm (a) as used, the INF returns the largest line in A and the square root of the product of Max (SUM (ABS (A)) ' fro ' A and a ', i.e. sqrt (SUM (diag (a'*a )))2If A is a vector, norm (a,p) returns the P-norm of vector A. That is, return sum (ABS (A).^P) ^ (1/p), for any1<p<+∞.norm (a) returns the 2 norm of Vector A, which is equivalent to norm (A,2). Norm (A,inf) returns MAX (ABS (a)) norm (A,-inf) return min (ABS (A))

8. Function handle

Function handle: Is the path that contains the function, the name of the function, the type, and the overloaded methods that may exist.
The function handle must be created by a specific definition, and the handle to the generic image is automatically established.

Create a function handle using the @ or STR2FUNC command to create
[[email protected]] [Email protected] [/email];
H_fun=str2func (' fun ');
such as the Sin function, [[email Protected]][email protected][/email]; H_sin=str2func (' sin ');

Execute the SIN function feval
Feval (' sin ', PI/2)
Ans =
1
So what's the benefit of using a function handle?
1, improve the speed of operation. Because MATLAB calls the function every time to search all the paths, from the set path we can see that the path is very much, so if a function in your program needs to be used frequently, the use of the function handle, you will improve the speed.
2, the use can be as convenient as the variable. For example, after I run this directory, I create a function handle to this directory, and when I go to the other directory, the function handle that I create can be called directly without having to copy the function file. Because the function handles you created already contains the path, for example, I created a fun
H_fun=str2func (' Rei ');
You can use functions to see the function, and the result is that it already includes the path.

Functions (H_fun)
Ans =
Function: ' Rei '
Type: ' Simple '
File: ' G:\PROGRAM\SERIAL232\REI.M '

Matlab Learning (a): Digital image processing functions used in large jobs

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.