²é¿´: 401  |  »Ø¸´: 2

lvjin1983

гæ (³õÈëÎÄ̳)

[ÇóÖú] Ë­ÓÐpudnµÄÕ˺ŰïÎÒÏÂÒ»ÏÂÕâ¸ö³ÌÐòллÁË

http://www.pudn.com/downloads62/sourcecode/math/detail218700.html
¸Õ×¢²áûÓÐʲôǮ£¬´ó¼Ò°ï°ïÎÒ°É
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

imyourkobe

Ìú¸Ëľ³æ (ÖøÃûдÊÖ)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï ¡ï
xzhdty(½ð±Ò+2): »¶Ó­³£À´³ÌÐòÓïÑÔ¿´¿´ 2011-10-20 22:28:43
´úÂëÄÚÈÝÈçÏ£º
function varargout = GridSimulation(varargin)
% GRIDSIMULATION M-file for GridSimulation.fig
%      GRIDSIMULATION, by itself, creates a new GRIDSIMULATION or raises the existing
%      singleton*.
%
%      H = GRIDSIMULATION returns the handle to a new GRIDSIMULATION or the handle to
%      the existing singleton*.
%
%      GRIDSIMULATION('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GRIDSIMULATION.M with the given input arguments.
%
%      GRIDSIMULATION('Property','Value',...) creates a new GRIDSIMULATION or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before GridSimulation_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to GridSimulation_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help GridSimulation

% Last Modified by GUIDE v2.5 25-Sep-2006 16:51:08
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @GridSimulation_OpeningFcn, ...
                   'gui_OutputFcn',  @GridSimulation_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before GridSimulation is made visible.
function GridSimulation_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to GridSimulation (see VARARGIN)

% Choose default command line output for GridSimulation
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes GridSimulation wait for user response (see UIRESUME)
% uiwait(handles.mainfig);
cla
global GridNumber
GridNumber=20;
DrawRectangle(GridNumber);
handles.StartPoint=findobj('tag','StartPoint');
handles.EndPoint=findobj('tag','EndPoint');
handles.Obstacle=findobj('tag','Obstacle');
handles.Start=findobj('tag','Start');
set(handles.StartPoint,'Enable','on')
set(handles.EndPoint,'Enable','off')
set(handles.Obstacle,'Enable','off')
set(handles.Start,'Enable','off')

%DrawRectangle
function DrawRectangle(m)
Dxy=1/m;
XNum=round(1.4/Dxy);
for i=1:1:m+1
    line([0 1.4],[Dxy*(i-1) Dxy*(i-1)],'Color',[0 1 0]);
    i=i+1;
end
for i=1:1:XNum+1
    line([Dxy*(i-1) Dxy*(i-1)],[0 1],'Color',[0 1 0]);
    i=i+1;
end
% --- Outputs from this function are returned to the command line.
function varargout = GridSimulation_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;

% --------------------------------------------------------------------
function GridSimulation_Callback(hObject, eventdata, handles)
% hObject    handle to GridSimulation (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function FileExit_Callback(hObject, eventdata, handles)
% hObject    handle to FileExit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
close(gcf);
% --------------------------------------------------------------------
function TowPointExp_Callback(hObject, eventdata, handles)
% hObject    handle to TowPointExp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function GridSim_Callback(hObject, eventdata, handles)
% hObject    handle to GridSim (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function GridExp_Callback(hObject, eventdata, handles)
% hObject    handle to GridExp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function NNSim_Callback(hObject, eventdata, handles)
% hObject    handle to NNSim (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function NNExp_Callback(hObject, eventdata, handles)
% hObject    handle to NNExp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function FNNSim_Callback(hObject, eventdata, handles)
% hObject    handle to FNNSim (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function FNNExp_Callback(hObject, eventdata, handles)
% hObject    handle to FNNExp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on selection change in listbox1.
function listbox1_Callback(hObject, eventdata, handles)
% hObject    handle to listbox1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns listbox1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from listbox1


% --- Executes during object creation, after setting all properties.
function listbox1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to listbox1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: listbox controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in Start.
function Start_Callback(hObject, eventdata, handles)
% hObject    handle to Start (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in End.
function End_Callback(hObject, eventdata, handles)
% hObject    handle to End (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in Obstacle.
function Obstacle_Callback(hObject, eventdata, handles)
% hObject    handle to Obstacle (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.StartPoint,'Enable','off')
set(handles.EndPoint,'Enable','off')
set(handles.Obstacle,'Enable','off')
set(handles.Start,'Enable','on')
global GridNumber;
for i=1:100 %ÉèÖÃÕϰ­Îï
[x,y,k]=ginput(1);
if k==3 return;end %ÉèÖÃÕϰ­Îïʱ°´ÓÒ¼ü½áÊø
x=x*GridNumber;y=y*GridNumber;
xx=round(x-0.5);
yy=round(y-0.5);
Grid(xx,yy)=1;
xx=xx/GridNumber;
yy=yy/GridNumber;
XX=linspace(xx,xx+1/GridNumber,100);
YY=linspace(yy+1/GridNumber,yy+1/GridNumber,100);
hold on
handleArea=area(XX,YY,yy);
end
% --- Executes on button press in Run.
function Run_Callback(hObject, eventdata, handles)
% hObject    handle to Run (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.StartPoint,'Enable','off')
set(handles.EndPoint,'Enable','off')
set(handles.Obstacle,'Enable','off')
set(handles.Start,'Enable','on')
k=1
% --- Executes on button press in Rerun.
function Rerun_Callback(hObject, eventdata, handles)
% hObject    handle to Rerun (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in Exit.
function Exit_Callback(hObject, eventdata, handles)
% hObject    handle to Exit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)



function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double


% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end




% --------------------------------------------------------------------
function File_Callback(hObject, eventdata, handles)
% hObject    handle to File (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function TwoPoint_Callback(hObject, eventdata, handles)
% hObject    handle to TwoPoint (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function TwoPointSim_Callback(hObject, eventdata, handles)
% hObject    handle to TwoPointSim (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function Grid_Callback(hObject, eventdata, handles)
% hObject    handle to Grid (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function NN_Callback(hObject, eventdata, handles)
% hObject    handle to NN (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function FNN_Callback(hObject, eventdata, handles)
% hObject    handle to FNN (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)




% --- Executes on button press in GridNumber.
function GridNumber_Callback(hObject, eventdata, handles)
% hObject    handle to GridNumber (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global GridNumber;
PromptStr={'ÇëÊäÈëÕ¤¸ñÊýÁ¿£¨´óÓÚ10СÓÚ50£©'};
DefNumber={'20'};
AnswerNumber=InputDlg(PromptStr,'ÉèÖÃÕ¤¸ñÊýÁ¿',1,DefNumber);
GridNumber=str2num(AnswerNumber{1});
cla
DrawRectangle(GridNumber);

% --- Executes on button press in StartPoint.
function StartPoint_Callback(hObject, eventdata, handles)
% hObject    handle to StartPoint (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global GridNumber;
set(handles.StartPoint,'Enable','off')
set(handles.EndPoint,'Enable','on')
set(handles.Obstacle,'Enable','off')
set(handles.Start,'Enable','off')
[x,y,k]=ginput(1);
x=x*GridNumber;y=y*GridNumber;
xx=round(x-0.5);
yy=round(y-0.5);
Grid(xx,yy)=1;
xx=xx/GridNumber;
yy=yy/GridNumber;
XX=linspace(xx,xx+1/GridNumber,100);
YY=linspace(yy+1/GridNumber,yy+1/GridNumber,100);
hold on
handleArea=area(XX,YY,yy);

% --- Executes on button press in EndPoint.
function EndPoint_Callback(hObject, eventdata, handles)
% hObject    handle to EndPoint (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
set(handles.StartPoint,'Enable','off')
set(handles.EndPoint,'Enable','off')
set(handles.Obstacle,'Enable','on')
set(handles.Start,'Enable','off')
global GridNumber;
[x,y,k]=ginput(1);
x=x*GridNumber;y=y*GridNumber;
xx=round(x-0.5);
yy=round(y-0.5);
Grid(xx,yy)=1;
xx=xx/GridNumber;
yy=yy/GridNumber;
XX=linspace(xx,xx+1/GridNumber,100);
YY=linspace(yy+1/GridNumber,yy+1/GridNumber,100);
hold on
handleArea=area(XX,YY,yy);
% --- Executes on button press in Obstacle.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject    handle to Obstacle (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in Start.
function Sart_Callback(hObject, eventdata, handles)
% hObject    handle to Start (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in ReStart.
function ReStart_Callback(hObject, eventdata, handles)
% hObject    handle to ReStart (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton13.
function pushbutton13_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)




% --- Executes on button press in GridFigExit.
function GridFigExit_Callback(hObject, eventdata, handles)
% hObject    handle to GridFigExit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
close(gcf);



% --------------------------------------------------------------------
function FileExplain_Callback(hObject, eventdata, handles)
% hObject    handle to FileExplain (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
2Â¥2011-10-20 18:25:59
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

ҹɫÈçË®

гæ (³õÈëÎÄ̳)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï
dubo(½ð±Ò+1): ¸Ðл²ÎÓë 2011-10-23 11:42:56
ÎÒÓÐQQ 74093687£¬ÎÒ¸øÄãϸö

[ ·¢×ÔÊÖ»ú°æ http://muchong.com/3g ]
3Â¥2011-10-23 11:00:08
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ lvjin1983 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ²ÄÁÏѧ˶297ÒѹýËÄÁù¼¶Çóµ÷¼ÁÍÆ¼ö +13 adaie 2026-03-19 13/650 2026-03-26 14:05 by ССÂóƬ
[¿¼ÑÐ] Ò»Ö¾Ô¸±±¾©»¯¹¤´óѧ²ÄÁÏÓ뻯¹¤£¨085600£©296Çóµ÷¼Á +5 µ¾ÆÞС±à 2026-03-26 5/250 2026-03-26 13:32 by yujianx
[¿¼ÑÐ] 291 Çóµ÷¼Á +7 »¯¹¤2026½ì±ÏÒµÉ 2026-03-21 8/400 2026-03-26 11:25 by AlenQIN.
[¿¼ÑÐ] ¿¼ÑÐÒ»Ö¾Ô¸ËÕÖÝ´óѧ³õʼ315£¨Ó¢Ò»£©Çóµ÷¼Á +3 sbdksD 2026-03-24 4/200 2026-03-25 18:16 by xcjcqu
[¿¼ÑÐ] Çóµ÷¼Á +3 ÀîÀî²»·þÊä 2026-03-25 3/150 2026-03-25 13:03 by cmz0325
[¿¼ÑÐ] 0703»¯Ñ§Çóµ÷¼Á +6 ÄÌÓͲÝÝ®. 2026-03-22 7/350 2026-03-25 10:00 by shangxh
[¿¼ÑÐ] 07»¯Ñ§280·ÖÇóµ÷¼Á +7 722865 2026-03-23 7/350 2026-03-25 09:29 by aa331100
[¿¼ÑÐ] ÉϺ£µçÁ¦´óѧ²ÄÁÏ·À»¤ÓëвÄÁÏÖØµãʵÑéÊÒÕÐÊÕµ÷¼ÁÑо¿Éú£¨²ÄÁÏ¡¢»¯Ñ§¡¢µç»¯Ñ§£¬»·¾³£© +4 ÎÒ°®Ñ§µç³Ø 2026-03-23 4/200 2026-03-25 00:59 by 1027_324
[¿¼ÑÐ] Ò»Ö¾Ô¸±±¾©»¯¹¤´óѧ 070300 ѧ˶ 336·Ö Çóµ÷¼Á +7 vvÃÔ 2026-03-22 7/350 2026-03-23 23:44 by Txy@872106
[¿¼ÑÐ] 333Çóµ÷¼Á +3 ALULU4408 2026-03-23 3/150 2026-03-23 19:04 by macy2011
[¿¼ÑÐ] 070300£¬Ò»Ö¾Ô¸±±º½320Çóµ÷¼Á +3 Jerry0216 2026-03-22 5/250 2026-03-23 09:16 by ¡£¡£ÌÃÌÃ
[¿¼ÑÐ] Ò»Ö¾Ô¸¶«»ª´óѧ»¯Ñ§070300£¬Çóµ÷¼Á +7 2117205181 2026-03-21 8/400 2026-03-22 22:55 by chixmc
[¿¼ÑÐ] 315·Ö£¬³ÏÇóµ÷¼Á£¬²ÄÁÏÓ뻯¹¤085600 +3 13756423260 2026-03-22 3/150 2026-03-22 20:11 by edmund7
[¿¼ÑÐ] Çóµ÷¼ÁÒ»Ö¾Ô¸º£´ó£¬0703»¯Ñ§Ñ§Ë¶304·Ö£¬Óдó´´ÏîÄ¿£¬Ëļ¶Òѹý +6 ÐÒÔËÁ¨Á¨ 2026-03-22 10/500 2026-03-22 20:10 by edmund7
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÖÐũҵ071010£¬×Ü·Ö320Çóµ÷¼Á +5 À§À§À§À§À¤À¤ 2026-03-20 6/300 2026-03-22 17:41 by hxsm
[¿¼ÑÐ] 319Çóµ÷¼Á +4 СÁ¦Æøçæçæ 2026-03-20 4/200 2026-03-22 15:53 by ColorlessPI
[¿¼ÑÐ] 085600²ÄÁÏÓ뻯¹¤306 +4 z1z2z3879 2026-03-21 4/200 2026-03-21 23:44 by ms629
[¿¼ÑÐ] 353Çóµ÷¼Á +3 À­¹³²»Ðí±ä 2026-03-20 3/150 2026-03-20 19:56 by JourneyLucky
[¿¼ÑÐ] 261ÇóBÇøµ÷¼Á£¬¿ÆÑо­Àú·á¸» +3 Å£Ä̺Üæ 2026-03-20 4/200 2026-03-20 19:34 by JourneyLucky
[¿¼ÑÐ] Ò»Ö¾Ô¸ÄÏÀí¹¤085701»·¾³302Çóµ÷¼ÁԺУ +3 ¿ûè÷ÎÀ¶Ó 2026-03-20 3/150 2026-03-20 19:28 by zhukairuo
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û