⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makegriddat.m

📁 数据挖掘的工具箱,最新版的,希望对做这方面研究的人有用
💻 M
字号:
function [griddat,x,y] = makegriddat(minx,maxx,miny,maxy,nrstepx,nrstepy)%MAKEGRIDDAT Make uniform 2D grid.%% [GRIDDAT,X,Y] = MAKEGRIDDAT(MINX,MAXX,MINY,MAXY,NRSTEPX,NRSTEPY)%% Make a uniform 2D grid of objects and store it in a 2xN array. This% array is not directly a PRTools dataset, but can be used for making% a 2D plot of a user function:%%   grid = makegriddat(0,10,0,10);%   out = f(grid);  % any method can be applied here.%   plotg(grid,out);%% This method uses GRIDSIZE when nrstepx and nrstepy are not supplied.%% See also: gendatgrid, plotg% Copyright: D.M.J. Tax, R.P.W. Duin, davidt@ph.tn.tudelft.nl% Faculty of Applied Physics, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlandsglobal GRIDSIZE;% when GRIDSIZE is needed, but it is not defined, we have to set it% ourselves:if nargin<6	if isempty(GRIDSIZE)		nrstepy = 30;	else		nrstepy = GRIDSIZE;	endendif nargin<5	if isempty(GRIDSIZE)		nrstepx = 10;	else		nrstepx = GRIDSIZE;	endend% Now the ranges over x and y can be defined:stepx = (maxx-minx)/(nrstepx-1);stepy = (maxy-miny)/(nrstepy-1);x = minx:stepx:maxx;y = miny:stepy:maxy;% To make the grid, we rely on a Matlab function:[gx,gy] = meshgrid(x,y);griddat=[reshape(gx,nrstepx*nrstepy,1), reshape(gy,nrstepx*nrstepy,1)];return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -