关于uigetfile命令打开路径的问题
用来显示检索文件的对话框的,格式为:uigetfile('FilterSpec','DialogTitle')或者[FileName,PathName] = uigetfile(...),其中的FilterSpec为'*.m';'*.mdl';'*.mat';'*.*',等等即为文件的格式,DialogTitle为标题名,FileName,PathName分别为选择的文件的文件名及路径名
JPG、GIF、PNG和BMP格式的图片各有什么优点和缺点
BMP:优点(无损压缩,图质最好),缺点(文件太大,不利于网络传输)
GIF:优点(动画存储格式),缺点(最多256色,画质差)
PNG:优点(可保存透明背景的图片),缺点(画质中等)
JPG:优点(文件小,利于网络传输),缺点(画质损失)
Matlab中guidata()的用法以及如何帮助参数在GUI间传递
handles 在gui中就是一个储存各种句柄和数据结构体.
guidata()函数是用来储存和取出这个结构体的函数, 将handles结构体存入figure的特定储存空间中或从中取出, 因此有两种用法:
1. guidata(hObject, handles); %%储存handles
2. handles = guidata(hObject); %%取出handles
------------------------------------------------------------------------------
handles仅仅只是一个结构体, 在函数之间传递时,如:
function push1_Callback(hObject, eventdata, handles)
handles.data1 = 'heygirl'; %将字符串存入handles结构体
guidata(hObject, handles);
axes(handles.axes1)
axes(handles.axes1)表示的是将上面的坐标轴做为当前坐标轴,在其上做图
bwareaopen()
matlab函数bwareaopen——删除小面积对象
格式:
BW2 = bwareaopen(BW,P,conn)
作用:
删除二值图像BW中面积小于P的对象,默认情况下conn使用8邻域。
subplot(m,n,p)括号中的代表什么意思?
subplot是将多个图画到一个平面上的工具。
其中,m和n代表在一个图像窗口中显示m行n列个图像,也就是整个figure中有n个图是排成一行的,一共m行,后面的p代表现在选定第p个图像区域,即在第p个区域作图。如果m=2就是表示2行图。p表示图所在的位置,p=1表示从左到右从上到下的第一个位置。
A(1,:)
A(1,:)表示这个矩阵的第一行
A(:,1)表示这个矩阵的第一列
sum()
S = sum(X) is the sum of the elements of the vector X.
If X is a matrix,S is a row vector with the sum over each column.
edge()
BW = edge(I,'sobel',THRESH,DIRECTION) specifies directionality for the
Sobel method. DIRECTION is a string or char vector specifying whether
to look for 'horizontal' or 'vertical' edges, or 'both' (the default).
max()
[Y,I] = max(X) returns the indices of the maximum values in vector/value I
If the values along the first non-singleton dimension contain more
than one maximal element, the index of the first one is returned.
round(X)
rounds each element of X to the nearest integer.(小数四舍五入转整数)
四舍五入到最近的整数,如round(-1.3)=-1;round(-1.52)=-2;round(1.3)=1;round(1.52)=2。