Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Cum sterg mails din Promotions

Vanzare cumparare fara transfer b...

Receptie ciudata, in functie de t...

Dupa 20 ani de facultate, am uita...
 Mobile.de ofera imprumut de bani ...

problema test grila

Digi24 a disparut de pe TV Lg

Drept de proprietate intelectuala...
 Jante noi shitbox

Trinitas TV 4K

Dacia 1316 cu 6 usi ...

Frecventa modificata radio
 Un nou pericol pt batrani

Ar trebui sa vindem imobiliarele ...

Dupa renuntarea la aparat dentar

pelerinaj in Balcik
 

[MATLAB][TEMA] Implementare GUI

  • Please log in to reply
No replies to this topic

#1
pokerstar99

pokerstar99

    New Member

  • Grup: Members
  • Posts: 1
  • Înscris: 15.06.2010
Implementa?i o interfa?ă grafică prin care să realiza?i un studiu al modula?iei MF(evolu?ie în timp ?i in frecven?ă). Se va urmări ca elementele AMPLITUDINE, FRECVEN?Ă, FRECV.PURTĂTOARE, FRECV.deESANTIONARE, NUMĂRUL DE PUNCTE FFT, să fie elemente editabile.


pana acum am scris asta :
function varargout = untitled1(varargin)
% UNTITLED1 M-file for untitled1.fig
%	  UNTITLED1, by itself, creates a new UNTITLED1 or raises the existing
%	  singleton*.
%
%	  H = UNTITLED1 returns the handle to a new UNTITLED1 or the handle to
%	  the existing singleton*.
%
%	  UNTITLED1('CALLBACK',hObject,eventData,handles,...) calls the local
%	  function named CALLBACK in UNTITLED1.M with the given input arguments.
%
%	  UNTITLED1('Property','Value',...) creates a new UNTITLED1 or raises the
%	  existing singleton*.  Starting from the left, property value pairs are
%	  applied to the GUI before untitled1_OpeningFcn gets called.  An
%	  unrecognized property name or invalid value makes property application
%	  stop.  All inputs are passed to untitled1_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 untitled1

% Last Modified by GUIDE v2.5 17-May-2010 20:14:42

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',	   mfilename, ...
				   'gui_Singleton',  gui_Singleton, ...
				   'gui_OpeningFcn', @untitled1_OpeningFcn, ...
				   'gui_OutputFcn',  @untitled1_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 untitled1 is made visible.
function untitled1_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 untitled1 (see VARARGIN)

% Choose default command line output for untitled1
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes untitled1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = untitled1_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 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.
input = str2num(get(hObject,'String'));
if (isempty(input))
	 set(hObject,'String','1')
	 msgboxText{1} =  'Introduceti un numar va rugam';
	 msgbox(msgboxText,'Nu este un numar valid', 'help');

end
guidata(hObject, handles);

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 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)
A=get(handles.edit1,'value');
axes(handles.axes1);
Fs = 4000; % rata de esantionare(8000 de esantioane pe secunda).
Fc = 150; % Frecventa purtatoare(Hz)--Atentie la legea lui Nyquist.
t = [0:.1*Fs]'/Fs; % Esantionarea se face din 0.1 secunde in 0.1 secunde
x = A*sin(2*pi*30*t)%+2*sin(2*pi*600*t); % Channel 1
%x=awgn(x,1,'measured')
dev=50;
y = fmmod(x,Fc,Fs,dev); % semnalul modulat AM;
%figure;
%subplot(2,3,1); plot(t,x); % Plot x on top.
%title('Semnalul sinusoidal nemodulat');
%xlabel('timp de esantionare');ylabel('Amplitudine');
%subplot(2,3,2);
plot(t,y)% Plot y below.

%title('Semnalul sinusoidal modulat(fara zgomot)');
 xlabel('timp de esantionare');%ylabel('Amplitudine');

 %subplot(2,3,3);
 
 %f=fmdemod(y,Fc,Fs,dev); % semnalul demodulat AM;
%plot(t,f,'b-');
%title('Semnal sinusoidal demodulat');
%xlabel('timp de esantionare');ylabel('Amplitudine');

%%y1-semnal modulat cu zgomot
%y1=awgn(y,8,'measured'); % se adauga zgomot alb gaussian.
%subplot(2,3,4); plot(t,y1)
%title('Semnalul sinusoidal modulat(cu zgomot)');
%xlabel('timp de esantionare');ylabel('Amplitudine');

%z = fmdemod(y1,Fc,Fs,dev); % z este semnalul demodulat.
%subplot(2,3,5); 
%plot(t,z);
%title('Semnalul sinusoidal demodulat(cu zgomot)');
%xlabel('timp de esantionare');ylabel('Amplitudine');

% Plot the original and recovered signals.
%subplot(2,3,6);
%plot(t,f,'b-',t,z,'r-');
%legend('Semnal inainte de modulare','Semnal dupa demodulare');
%title('Semnal inainte de modulare/Semnal dupa demodulare');
%xlabel('timp de esantionare');ylabel('Amplitudine');


% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject	handle to slider1 (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,'Value') returns position of slider
%		get(hObject,'Min') and get(hObject,'Max') to determine range of slider
% --- Executes during object creation, after setting all properties.

sliderValue = get(handles.slider1,'Value');

set(handles.edit2,'String', num2str(sliderValue));

guidata(hObject, handles);

function slider1_CreateFcn(hObject, eventdata, handles)
% hObject	handle to slider1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles	empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
	set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- 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)


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



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 during object creation, after setting all properties.
Fc = str2num(get(hObject,'String'));
if (isempty(Fc))
	 set(hObject,'String','0')
	  msgboxText{1} =  'Introduceti un numar cuprins intre 0 si 2070,va rugam';
	msgbox(msgboxText,'Nu este un numar valid', 'help');
end
guidata(hObject, handles);


if (isempty(Fc) || Fc < 0 || Fc > 2000)
	set(hObject,'String','0')
	msgboxText{1} =  'Introduceti un numar cuprins intre 0 si 2000,va rugam';
	msgbox(msgboxText,'Nu este un numar valid', 'help');
else
	set(handles.slider1,'Value',sliderValue);
end

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


% --- Executes on slider movement.
function slider2_Callback(hObject, eventdata, handles)
% hObject	handle to slider1 (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,'Value') returns position of slider
%		get(hObject,'Min') and get(hObject,'Max') to determine range of slider
% --- Executes during object creation, after setting all properties.

sliderValue = get(handles.slider2,'Value');

set(handles.edit1,'String', num2str(sliderValue));

guidata(hObject, handles);
function slider2_CreateFcn(hObject, eventdata, handles)
% hObject	handle to slider2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles	empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
	set(hObject,'BackgroundColor',[.9 .9 .9]);
end





dar nu este complet si imi da erori ..cine ma poate ajuta !!!

Edited by dani.user, 15 June 2010 - 15:26.
codebox


Anunturi

Chirurgia cranio-cerebrală minim invazivă Chirurgia cranio-cerebrală minim invazivă

Tehnicile minim invazive impun utilizarea unei tehnologii ultramoderne.

Endoscoapele operatorii de diverse tipuri, microscopul operator dedicat, neuronavigația, neuroelectrofiziologia, tehnicile avansate de anestezie, chirurgia cu pacientul treaz reprezintă armamentarium fără de care neurochirurgia prin "gaura cheii" nu ar fi posibilă. Folosind tehnicile de mai sus, tratăm un spectru larg de patologii cranio-cerebrale.

www.neurohope.ro

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate