如何使用 MATLAB 进行数据爬虫、数据处理、数据可视化分析等等(待更新)

Data crawler introduction

What is Data Crawler?

Or another way of saying is that Data Spider. So let’s just say that catch and get data from Browser (Internet Explorer). Through Data processing, we can gain useful data from catched data source. Visualize the data with Visual Diagram or Visual Table.

Image Processing introduction

Read and Display Image

%% Read a sample image.
A = imread('picture_sample.jpg');

Imread returns a 650-by-600-by-3 array. 650-by-600 is the size of image. The number 3 is the pipes quantity of image.

Display the image.

image(A)

If the file is located by an internet URL, then filename must contain the protocol type such as, http://.

Example: ‘http://hostname/path_to_file/my_image.jpg’

Image Object details

Image data, returned as an array.

If the file contains a grayscale image, then A is an m-by-n array.

If the file contains an indexed image, then A is an m-by-n array of index values corresponding to the color at that index in map.

If the file contains a truecolor image, then A is an m-by-n-by-3 array.

If the file is a TIFF file containing color images that use the CMYK color space, then A is an m-by-n-by-4 array.

What is TIFF file?

Tag Image File Format,TIFF, along with JPEG and PNG, is one of the most popular high-altitude color image formats.

MATLAB Basic functions introduction

input Function introduction

x = input(prompt)
str = input(prompt,'s')

Displays the text in prompt and waits for the user to input a value and press the Return key.

webread Function introduction

data = webread(url) reads content from the web service specified by url and returns the content in data.

strcat Function introduction

s = strcat(s1,…,sN) horizontally concatenates s1,…,sN. Each input argument can be a character array, a cell array of character vectors, or a string array.

isa Function introduction

K = isa(obj, 'Class_Name') check obj whether it is Class_Name Type.

tf = isa(A, dataType) returns 1 (true) if A has the data type specified by dataType. Otherwise, it returns 0 (false). The input argument A can have any data type.

imshow Function introduction

imshow(I) displays the grayscale image I in a figure.

Write Grayscale Image to PNG

Write a 50-by-50 array of grayscale values to a PNG file in the current folder.

A = rand(50);
imwrite(A,'myGray.png')

Save variables by specified type

append the specified variable m in existed mat file.

save('abc.mat','m''-append')

猜你喜欢

转载自blog.csdn.net/qq_47452807/article/details/128170052