informa |  |
| | kinimod | 29.05.2008 12:27:05 | 

Grupa: Administrator 
Lokalizacja: Gotenhafen
Posty: 223 #121188 Od: 2007-10-18
| function varargout = tabliczka(varargin) % TABLICZKA M-file for tabliczka.fig % TABLICZKA, by itself, creates a new TABLICZKA or raises the existing % singleton*. % % H = TABLICZKA returns the handle to a new TABLICZKA or the handle to % the existing singleton*. % % TABLICZKA('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in TABLICZKA.M with the given input arguments. % % TABLICZKA('Property','Value',...) creates a new TABLICZKA or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before tabliczka_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to tabliczka_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 tabliczka
% Last Modified by GUIDE v2.5 29-May-2008 11:27:19
% Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @tabliczka_OpeningFcn, ... 'gui_OutputFcn', @tabliczka_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 tabliczka is made visible. function tabliczka_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 tabliczka (see VARARGIN)
% Choose default command line output for tabliczka handles.output = hObject;
% Update handles structure guidata(hObject, handles);
% UIWAIT makes tabliczka wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = tabliczka_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; rand('state',sum(100*clock)); a=round(rand*10); b=round(rand*10); set(handles.edit1,'value',a); set(handles.edit1,'string',a); set(handles.edit2,'value',b); set(handles.edit2,'string',b); set(handles.edit3,'string',''); pkt=0; nt=0; set(handles.edit4,'value',pkt); set(handles.edit4,'string',num2str(pkt)); set(handles.edit5,'value',nt); set(handles.edit5,'string',num2str(nt*2)); set(handles.edit7,'visible','off'); set(handles.text7,'visible','off'); set(handles.edit1,'enable','off'); set(handles.edit2,'enable','off'); set(handles.edit4,'enable','off'); set(handles.edit5,'enable','off'); set(handles.text6,'backgroundcolor',[0 1 0]); set(handles.edit5,'backgroundcolor',[1 1 0]);
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
% --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (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 edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (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 edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (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 edit4_Callback(hObject, eventdata, handles) % hObject handle to edit4 (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 edit4 as text % str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, eventdata, handles) % hObject handle to edit4 (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 edit5_Callback(hObject, eventdata, handles) % hObject handle to edit5 (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 edit5 as text % str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties. function edit5_CreateFcn(hObject, eventdata, handles) % hObject handle to edit5 (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 edit6_Callback(hObject, eventdata, handles) % hObject handle to edit5 (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 edit5 as text % str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties. function edit6_CreateFcn(hObject, eventdata, handles) % hObject handle to edit5 (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 edit7_Callback(hObject, eventdata, handles) % hObject handle to edit7 (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 edit7 as text % str2double(get(hObject,'String')) returns contents of edit7 as a double
% --- Executes during object creation, after setting all properties. function edit7_CreateFcn(hObject, eventdata, handles) % hObject handle to edit7 (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
% --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) nt=get(handles.edit5,'string'); nt=eval(nt); if nt==0 set(handles.edit6,'enable','off'); Lt=get(handles.edit6,'string'); Lt=eval(Lt); if Lt<10 Lt=10; set(handles.edit6,'string','10'); end; end; Lt=get(handles.edit6,'string'); Lt=eval(Lt); if nt<Lt*2; a=get(handles.edit1,'string'); b=get(handles.edit2,'string'); c=get(handles.edit3,'string'); pkt=get(handles.edit4,'string'); a=eval(a); b=eval(b); pkt=eval(pkt);
[c spr]=str2num(c); if spr==1 if c==a*b pkt=pkt+2; else pkt=pkt-1; end; end; nt=nt+2;
set(handles.edit5,'string',num2str(nt)); set(handles.edit4,'string',pkt); if nt<Lt*2 set(handles.edit3,'string',''); a=round(rand*10) b=round(rand*10) %set(handles.edit1,'value',a); set(handles.edit1,'string',a); %set(handles.edit2,'value',b); set(handles.edit2,'string',b); else set(handles.edit7,'visible','on'); set(handles.t7,'visible','on'); ocena=4*pkt/2/Lt+1; if ocena<2; ocena=2 end; set(handles.edit7,'string',sprintf('%5.1f',ocena)); set(handles.edit1,'visible','off'); set(handles.edit2,'visible','off'); set(handles.edit3,'visible','off'); set(handles.t1,'visible','off'); set(handles.t2,'visible','off'); set(handles.t3,'visible','off'); set(handles.pushbutton1,'visible','off'); end end % --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
function edit8_Callback(hObject, eventdata, handles) % hObject handle to edit6 (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 edit6 as text % str2double(get(hObject,'String')) returns contents of edit6 as a double
% --- Executes during object creation, after setting all properties. function edit8_CreateFcn(hObject, eventdata, handles) % hObject handle to edit6 (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 edit2_Callback(hObject, eventdata, handles) % hObject handle to edit2 (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 edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes on button press in pushbutton3. function pushbutton3_Callback(hObject, eventdata, handles) % hObject handle to pushbutton3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
| | | kinimod | 29.05.2008 12:35:23 | 

Grupa: Administrator 
Lokalizacja: Gotenhafen
Posty: 223 #121189 Od: 2007-10-18
| function varargout = tabliczka(varargin) % TABLICZKA M-file for tabliczka.fig % TABLICZKA, by itself, creates a new TABLICZKA or raises the existing % singleton*. % % H = TABLICZKA returns the handle to a new TABLICZKA or the handle to % the existing singleton*. % % TABLICZKA('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in TABLICZKA.M with the given input arguments. % % TABLICZKA('Property','Value',...) creates a new TABLICZKA or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before tabliczka_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to tabliczka_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 tabliczka
% Last Modified by GUIDE v2.5 29-May-2008 11:27:19
% Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @tabliczka_OpeningFcn, ... 'gui_OutputFcn', @tabliczka_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 tabliczka is made visible. function tabliczka_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 tabliczka (see VARARGIN)
% Choose default command line output for tabliczka handles.output = hObject;
% Update handles structure guidata(hObject, handles);
% UIWAIT makes tabliczka wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. function varargout = tabliczka_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; rand('state',sum(100*clock)); a=round(rand*10); b=round(rand*10); set(handles.edit1,'value',a); set(handles.edit1,'string',a); set(handles.edit2,'value',b); set(handles.edit2,'string',b); set(handles.edit3,'string',''); pkt=0; nt=0; set(handles.edit4,'value',pkt); set(handles.edit4,'string',num2str(pkt)); set(handles.edit5,'value',nt); set(handles.edit5,'string',num2str(nt*2)); set(handles.edit7,'visible','off'); set(handles.t7,'visible','off'); set(handles.edit1,'enable','off'); set(handles.edit2,'enable','off'); set(handles.edit4,'enable','off'); set(handles.edit5,'enable','off'); set(handles.t6,'backgroundcolor',[0 1 0]); set(handles.edit5,'backgroundcolor',[1 1 0]);
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
% --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (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 edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (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 edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (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 edit4_Callback(hObject, eventdata, handles) % hObject handle to edit4 (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 edit4 as text % str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, eventdata, handles) % hObject handle to edit4 (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 edit5_Callback(hObject, eventdata, handles) % hObject handle to edit5 (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 edit5 as text % str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties. function edit5_CreateFcn(hObject, eventdata, handles) % hObject handle to edit5 (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 edit6_Callback(hObject, eventdata, handles) % hObject handle to edit5 (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 edit5 as text % str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties. function edit6_CreateFcn(hObject, eventdata, handles) % hObject handle to edit5 (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 edit7_Callback(hObject, eventdata, handles) % hObject handle to edit7 (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 edit7 as text % str2double(get(hObject,'String')) returns contents of edit7 as a double
% --- Executes during object creation, after setting all properties. function edit7_CreateFcn(hObject, eventdata, handles) % hObject handle to edit7 (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
% --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) nt=get(handles.edit5,'string'); nt=eval(nt); if nt==0 set(handles.edit6,'enable','off'); Lt=get(handles.edit6,'string'); Lt=eval(Lt); if Lt<10 Lt=10; set(handles.edit6,'string','10'); end; end; Lt=get(handles.edit6,'string'); Lt=eval(Lt); if nt<Lt*2; a=get(handles.edit1,'string'); b=get(handles.edit2,'string'); c=get(handles.edit3,'string'); pkt=get(handles.edit4,'string'); a=eval(a); b=eval(b); pkt=eval(pkt);
[c spr]=str2num(c); if spr==1 if c==a*b pkt=pkt+2; else pkt=pkt-1; end; end; nt=nt+2;
set(handles.edit5,'string',num2str(nt)); set(handles.edit4,'string',pkt); if nt<Lt*2 set(handles.edit3,'string',''); a=round(rand*10) b=round(rand*10) %set(handles.edit1,'value',a); set(handles.edit1,'string',a); %set(handles.edit2,'value',b); set(handles.edit2,'string',b); else set(handles.edit7,'visible','on'); set(handles.t7,'visible','on'); ocena=4*pkt/2/Lt+1; if ocena<2; ocena=2 end; set(handles.edit7,'string',sprintf('%5.1f',ocena)); set(handles.edit1,'visible','off'); set(handles.edit2,'visible','off'); set(handles.edit3,'visible','off'); set(handles.t1,'visible','off'); set(handles.t2,'visible','off'); set(handles.t3,'visible','off'); set(handles.pushbutton1,'visible','off'); end end function pushbutton2_Callback(hObject,eventdata,handles) nt=get(handles.edit5,'string'); nt=eval(nt); Lt=get(handles.edit6,'string'); Lt=eval(Lt); if nt==Lt*2 close(gcf); end; % --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
function edit8_Callback(hObject, eventdata, handles) % hObject handle to edit6 (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 edit6 as text % str2double(get(hObject,'String')) returns contents of edit6 as a double
% --- Executes during object creation, after setting all properties. function edit8_CreateFcn(hObject, eventdata, handles) % hObject handle to edit6 (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 edit2_Callback(hObject, eventdata, handles) % hObject handle to edit2 (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 edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes on button press in pushbutton3. function pushbutton3_Callback(hObject, eventdata, handles) % hObject handle to pushbutton3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) | | | kinimod | 29.05.2008 12:59:44 | 

Grupa: Administrator 
Lokalizacja: Gotenhafen
Posty: 223 #121198 Od: 2007-10-18
Ilość edycji wpisu: 1 | clc clear all close(gcf); disp('Objetosc czworoscianu i powierzchnia boczna'); p1=input('P1='); p2=input('P2='); p3=input('P3='); p4=input('P4='); w=[(p2-p1)' (p3-p1)' (p4-p1)']; objetosc=abs(det(w))/2 s1=[p1' p2' p3' p1']; s2=[p1' p2' p4' p1']; s3=[p2' p3' p4' p2']; s4=[p1' p3' p4' p1']; fill3(s1(1, ,s1(2, ,s1(3, ,[1 0 0]); hold on fill3(s2(1, ,s2(2, ,s2(3, ,[0 1 0]); fill3(s3(1, ,s3(2, ,s3(3, ,[0 0 1]); fill3(s4(1, ,s4(2, ,s4(3, ,[1 1 0]); grid sciana1=abs(det(rot90([(p2-p1)' (p3-p1)' [1;1;1]])))/2 sciana2=abs(det(rot90([(p2-p1)' (p4-p1)' [1;1;1]])))/2 sciana3=abs(det(rot90([(p4-p1)' (p3-p1)' [1;1;1]])))/2 sciana4=abs(det(rot90([(p3-p2)' (p4-p2)' [1;1;1]])))/2 | | | szczurek | 29.05.2008 13:01:25 | 

Grupa: Użytkownik
Lokalizacja: Frog District :)
Posty: 426 #121199 Od: 2007-10-18
| clc clear all close (gcf); disp('Objetosc czworoscianu i powierzchnia boczna'); p1=input('P1='); p2=input('P2='); p3=input('P3='); p4=input('P4='); w=[(p2-p1)' (p3-p1)' (p4-p1)']; objetosc=abs(det(w))/2 s1=[p1' p2' p3' p1']; s2=[p1' p2' p4' p1']; s3=[p2' p3' p4' p2']; s4=[p1' p3' p4' p1']; fill3(s1(1, ,s1(2, ,s1(3, ,[1 0 0]); hold on fill3(s2(1, ,s2(2, ,s2(3, ,[0 1 0]); fill3(s3(1, ,s3(2, ,s3(3, ,[0 0 1]); fill3(s4(1, ,s4(2, ,s4(3, ,[1 1 0]); grid sciana1=abs(det(rot90([(p2-p1)' (p3-p1)' [1;1;1]])))/2 sciana2=abs(det(rot90([(p2-p1)' (p4-p1)' [1;1;1]])))/2 sciana3=abs(det(rot90([(p4-p1)' (p3-p1)' [1;1;1]])))/2 sciana4=abs(det(rot90([(p3-p2)' (p4-p2)' [1;1;1]])))/2 _________________
   | | | kinimod | 29.05.2008 13:18:55 | 

Grupa: Administrator 
Lokalizacja: Gotenhafen
Posty: 223 #121201 Od: 2007-10-18
| clear all clc close(gcf) aviobj=avifile('obrprost.avi','fps',10); a=[-10 -9 -9 -10; ;-10 -10 -9.5 -9.5]; axis([-10 10 -11 10]); axis square hold on bpo=a; fi=0; grid;
lp=23; fi=pi/16; xpp=bpo(1, ; ypp=bpo(2, ; for i=1:lp xp=bpo(1, ; yp=bpo(2, ; h=line([xpp xpp(1)],[ypp ypp(1)]); h=line([xp xp(1)],[yp yp(1)]); xpp=xp; ypp=yp; frame=getframe(gca); aviobj=addframe(aviobj,frame); set(h,'EraseMode','xor'); srx=mean(xp); sry=mean(yp); xpo=xp-srx; ypo=yp-sry; bpo=[xpo; ypo]; mobr=[cos(fi) sin(fi); -sin(fi) cos(fi)]; bpo=mobr*bpo; srx=srx+20/lp; sry=sry-0.4*srx; bpo(1, =bpo(1, +srx; bpo(2, =bpo(2, +sry; end aviobj=close(aviobj); | | | magda | 29.05.2008 17:52:55 | 

Grupa: Administrator 
Lokalizacja: Chełm
Posty: 953 #121289 Od: 2007-10-19
| to mnie sie przyda :] bo moja grupa jest troszeczku zacofana ;p | | | wojasz | 29.05.2008 18:07:59 | 

Grupa: Użytkownik
Lokalizacja: ...---===GDYNIA===---...
Posty: 462 #121292 Od: 2007-10-21
| nic nowego :p | | | anulka | 05.06.2008 09:17:30 | 
Grupa: Użytkownik
Lokalizacja: Klooklyn :)
Posty: 317 #123943 Od: 2007-10-18
| clear all clc clf disp('rejestracja danych'); x=[0:0.1:8*pi]; y=exp(-x/10).*cos(x); [p s]=uiputfile('*.*','Wpisz nazwe pliku'); plot(x,y); grid save([s p]); | | | anulka | 05.06.2008 09:17:58 | 
Grupa: Użytkownik
Lokalizacja: Klooklyn :)
Posty: 317 #123944 Od: 2007-10-18
| clear all clc clf disp('wczytywanie danych'); [p s]=uigetfile('*.*','Wybierz nazwe pliku'); load([s p]); plot(x,y,x,y.^2); legend('w1','w2'); grid | | | anulka | 05.06.2008 10:49:59 | 
Grupa: Użytkownik
Lokalizacja: Klooklyn :)
Posty: 317 #123962 Od: 2007-10-18
| close(gcf) clear all x=[-7.5:0.5:7.5]; y=x; [x,y]=meshgrid(x,y); z=sin((x.^2+y.^2)/50).*exp(-(x/10).^2-(y/10).^2); surf(x,y,z); grid
| | | sunshine | 05.06.2008 11:47:20 | 

Grupa: Użytkownik
Lokalizacja: Tczew
Posty: 293 #123983 Od: 2007-10-19
| axes(handles.axes1); cla; ymax=get(handles.edit2,'string'); ymax=eval(ymax); ymin=get(handles.edit3,'string'); ymin=eval(ymin); xmin=get(handles.edit4,'string'); xmin=eval(xmin); xmax=get(handles.edit5,'string'); xmax=eval(xmax); axis([xmin xmax ymin ymax]); grid hold on x=[xmin xmax-xmin)/1000 max]; plot(x,7*sin(x),'r');
| | | szczurek | 05.06.2008 12:08:23 | 

Grupa: Użytkownik
Lokalizacja: Frog District :)
Posty: 426 #123989 Od: 2007-10-18
| cla axes(handles.axes1); ymax=get(handles.edit2,'string'); ymax=eval(ymax); ymin=get(handles.edit3,'string'); ymin=eval(ymin); xmin=get(handles.edit4,'string'); xmin=eval(xmin); xmax=get(handles.edit5,'string'); xmax=eval(xmax); axis([xmin xmax ymin ymax]); xc=[xmin xmax-xmin)/1000 max]; fun=get(handles.edit1,'string'); r=size(xc); p=get(handles.radiobutton1,'value'); if p==1 for i=1:r(2) x=xc(i); y(i)=eval(fun); end; plot(xc,y,'r'); end; p=get(handles.radiobutton2,'value'); if p==1 pfun=diff(fun); for i=1:r(2) x=xc(i); py(i)=eval(pfun); end; plot(xc,py,'b'); end; p=get(handles.radiobutton3,'value'); if p==1 cfun=int(fun); for i=1:r(2) x=xc(i); cy(i)=eval(cfun); end; plot(xc,cy,'g'); end; _________________
   | | | bartosz | 05.06.2008 12:13:15 | 
Grupa: Użytkownik
Lokalizacja: Sztum-jeden wielki PGR!;)
Posty: 173 #123990 Od: 2007-10-20
| cla axes(handles.axes1); ymax=get(handles.edit2,'string'); ymax=eval(ymax); ymin=get(handles.edit3,'string'); ymin=eval(ymin); xmin=get(handles.edit4,'string'); xmin=eval(xmin); xmax=get(handles.edit5,'string'); xmax=eval(xmax); axis([xmin xmax ymin ymax]); xc=[xmin xmax-xmin)/1000 max]; fun=get(handles.edit1,'string'); r=size(xc); p=get(handles.radiobutton1,'value'); if p==1 for i=1:r(2) x=xc(i); y(i)=eval(fun); end; plot(xc,y,'r'); end; p=get(handles.radiobutton2,'value'); if p==1 pfun=diff(fun); for i=1:r(2) x=xc(i); p(y)=eval(pfun); end; plot(xc,py,'b'); end; p=get(handles.radiobutton3,'value'); if p==1 cfun=int(fun); for i=1:r(2) x=xc(i); c(y)=eval(cfun); end; plot(xc,cy,'g'); end; | | | szczurek | 05.06.2008 12:20:32 | 

Grupa: Użytkownik
Lokalizacja: Frog District :)
Posty: 426 #123992 Od: 2007-10-18
| cla axes(handles.axes1); ymax=get(handles.edit2,'string'); ymax=eval(ymax); ymin=get(handles.edit3,'string'); ymin=eval(ymin); xmin=get(handles.edit4,'string'); xmin=eval(xmin); xmax=get(handles.edit5,'string'); xmax=eval(xmax); axis([xmin xmax ymin ymax]); xc=[xmin xmax-xmin)/1000 max]; fun=get(handles.edit1,'string'); r=size(xc); p=get(handles.radiobutton1,'value'); if p==1 for i=1:r(2) x=xc(i); y(i)=eval(fun); end; plot(xc,y,'r'); end; p=get(handles.radiobutton2,'value'); if p==1 pfun=diff(fun); for i=1:r(2) x=xc(i); py(i)=eval(pfun); end; plot(xc,py,'b'); end; p=get(handles.radiobutton3,'value'); if p==1 cfun=int(fun); for i=1:r(2) x=xc(i); cy(i)=eval(cfun); end; plot(xc,cy,'g'); end;
_________________
   | | | sunshine | 05.06.2008 12:22:38 | 

Grupa: Użytkownik
Lokalizacja: Tczew
Posty: 293 #123993 Od: 2007-10-19
| http://www.sendspace.com/file/8r8cu7 | | | szczurek | 05.06.2008 12:24:42 | 

Grupa: Użytkownik
Lokalizacja: Frog District :)
Posty: 426 #123994 Od: 2007-10-18
|
TYLKO ZAREJESTROWANI I ZALOGOWANI UŻYTKOWNICY WIDZĄ LINKI » DARMOWA REJESTRACJA
TYLKO ZAREJESTROWANI I ZALOGOWANI UŻYTKOWNICY WIDZĄ LINKI » DARMOWA REJESTRACJA
_________________
   | | | anulka | 05.06.2008 12:50:32 | 
Grupa: Użytkownik
Lokalizacja: Klooklyn :)
Posty: 317 #123999 Od: 2007-10-18
| clc f1=str2double(get(handles.edit2,'String')); f2=str2double(get(handles.edit4,'String')); f3=str2double(get(handles.edit6,'String')); A1=str2double(get(handles.edit1,'String')); A2=str2double(get(handles.edit3,'String')); A3=str2double(get(handles.edit5,'String')); fmin=min([f1 f2 f3]); fmax=2*max([f1 f2 f3]); tz=4/fmin; tz=0.1; t=[0:tz/1024:tz-tz/1024]; axes(handles.axes1); df=1/tz; x=A1*cos(2*pi*f1*t)+A2*cos(2*pi*f2*t)+A3*cos(2*pi*f3*t); plot(t,x) grid on f=[0:df:39*df]; y=fft(x); m=abs(y)/512; m=m(1:40); axes(handles.axes2) bar(f,m) grid on | | | szczurek | 05.06.2008 13:18:35 | 

Grupa: Użytkownik
Lokalizacja: Frog District :)
Posty: 426 #124003 Od: 2007-10-18
|
TYLKO ZAREJESTROWANI I ZALOGOWANI UŻYTKOWNICY WIDZĄ LINKI » DARMOWA REJESTRACJA
TYLKO ZAREJESTROWANI I ZALOGOWANI UŻYTKOWNICY WIDZĄ LINKI » DARMOWA REJESTRACJA
_________________
   | | | kinimod | 05.06.2008 13:23:33 | 

Grupa: Administrator 
Lokalizacja: Gotenhafen
Posty: 223 #124005 Od: 2007-10-18
| clc clear all syms a b c x disp('Funkcja'); s=a*x^2+b*x+c disp('pieriastek rowniania'); pierw=solve(s) disp('Pochodna funkcji'); pf=diff(s) disp('calka funkcji'); cf=int(s) | | | szczurek | 12.06.2008 11:36:06 | 

Grupa: Użytkownik
Lokalizacja: Frog District :)
Posty: 426 #127587 Od: 2007-10-18
|
TYLKO ZAREJESTROWANI I ZALOGOWANI UŻYTKOWNICY WIDZĄ LINKI » DARMOWA REJESTRACJA
_________________
   |
Aby pisac na forum musisz sie zalogować !!! |
|