Matlab - Problemas con Imagen de Fondo GUIDE

 
Vista:

Problemas con Imagen de Fondo GUIDE

Publicado por Sou Bnd (1 intervención) el 02/04/2018 17:56:00
Buen dia


Actualmente tengo problemas al insertar una imagen de fondo en la GUIDE, la imagen aparece, pero queda encima de las demás axes (las gráficas), ya utilice las opciones de Bring to front y back y sigue igual, seria de mucha ayuda son apoyo.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
function varargout = FiltrajeOptimo(varargin)
% FILTRAJEOPTIMO M-file for FiltrajeOptimo.fig
%      FILTRAJEOPTIMO, by itself, creates a new FILTRAJEOPTIMO or raises the existing
%      singleton*.
%
%      H = FILTRAJEOPTIMO returns the handle to a new FILTRAJEOPTIMO or the handle to
%      the existing singleton*.
%
%      FILTRAJEOPTIMO('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in FILTRAJEOPTIMO.M with the given input arguments.
%
%      FILTRAJEOPTIMO('Property','Value',...) creates a new FILTRAJEOPTIMO or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before proyecto1_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to FiltrajeOptimo_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 FiltrajeOptimo

% Last Modified by GUIDE v2.5 01-Apr-2011 23:30:14

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @FiltrajeOptimo_OpeningFcn, ...
                   'gui_OutputFcn',  @FiltrajeOptimo_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && isstr(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 FiltrajeOptimo is made visible.
function FiltrajeOptimo_OpeningFcn(hObject, eventdata, handles, varargin)
zoom off
axes(handles.logo);

    image(imread('blue','png'));
    
text(780,20,' Instituto America','Fontname', ...
    'Arial','Fontangle','Italic','Fontweight','Bold', ...
    'Fontsize',16,'color',[1 1 1]);

text(602,50,'Tratamiento Digital de la Informacion','Fontname', ...
    'Arial','Fontangle','Italic','Fontweight','Bold', ...
    'Fontsize',16,'color',[1 1 1]);

text(800,80,'Proyecto Final','Fontname', ...
    'Arial','Fontangle','Italic','Fontweight','Bold', ...
    'Fontsize',16,'color',[1 1 1]);

set(handles.logo,'Xtick',[]);
set(handles.logo,'Ytick',[]);

handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% --- Outputs from this function are returned to the command line.
function varargout = FiltrajeOptimo_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;

% --- Executes during object creation, after setting all properties.
function opciones_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','White');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

% --- Executes on selection change in opciones.
function opciones_Callback(hObject, eventdata, handles)

% --- Executes during object creation, after setting all properties.
function ruido_CreateFcn(hObject, eventdata, handles)
if ispc
    set(hObject,'BackgroundColor','White');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

function ruido_Callback(hObject, eventdata, handles)

% --- Executes on button press in salir.
function salir_Callback(hObject, eventdata, handles)
close all

% --- Executes on button press in graficar.
function graficar_Callback(hObject, eventdata, handles)
opcion = get(handles.opciones,'Value');
nivelruido= str2double(get(handles.ruido,'String'));
if isnan(nivelruido) || nivelruido>100 || nivelruido<0
     set(handles.ruido,'String',5);
     nivelruido = 5;
end
if opcion==1
    
  %%%%%% En este bloque generamos el ruido
ts=1e-4;
tnoise=0:1/5000:1-1/5000;
stdnoise=50e-3;
noise=stdnoise*randn(size(tnoise));

%%%%%% En este bloque generamos la se�al NRZ
fs=10000;% Muestreo de 10K Hz
T=1/5000;
t=[0:1/5000:1-1/5000]; % Vector tiempo de 1 a  5 segundos de 50000 ptos
LM = 5; % Duracion del mensaje 5 muestras
men= randi([0,1],1,LM); % Mensaje de 5 muestras de ceros y unos
Tbit=0.1;
N=Tbit*fs;

    for k=0:LM-1;
        for j=(1+k*N):(N+k*N)
            nrz(j)=men(k+1);
        end
    end
  
  set(handles.SOriginal,'Visible', 'on');
  plot(handles.SOriginal,t,nrz); % Se�al NRZ
  ylim(handles.SOriginal,[-0.1 1.2]);
  grid on;
  

%%%%%% En este bloque sumamos la se�al NRZ con el ruido
mensucio=nrz+nivelruido.*noise;
set(handles.SplusNoise,'Visible', 'on');
plot(handles.SplusNoise,t,mensucio);
grid on;

%%%%%% En este bloque creamos el filtro
tfiltro=[0:1/5000:0.2-1/5000];
filtro = [ones(1,1000)];
set(handles.Filtro,'Visible', 'on');
plot(handles.Filtro,tfiltro,filtro);


%%%%%% En este bloque realizamos la convolucion de la se�al sucia con el
%%%%%% filtro y graficamos el resultado. 
[filtrada,ny2]=ctc(mensucio,t,filtro,tfiltro,T);
if (mean(nrz)~=0)
    filtrada=filtrada/max(filtrada);
end
set(handles.SFiltrada,'Visible', 'on');
plot(handles.SFiltrada,ny2,filtrada);  
grid(handles.SFiltrada);

end
if opcion==2
    
T=16/4000;
t=[0:16/4000:16-16/4000]; 

%%%%%% En este bloque cargamos la se�al ecg3.
ecg=load('ecg3.dat');
ecg=ecg.';
set(handles.SOriginal,'Visible', 'on');
plot(handles.SOriginal,t,ecg);
grid;
 
%%%%%% En este bloque tomamos un ciclo de la se�al ecg3 para hacer el
%%%%%% filtro
tfiltro=[0:16/4000:0.64-16/4000];
 
    for k=1:160;% Tomamos los 160 puntos de la se�al ecg lo que equivale a un periodo de la misma
        filtro(k)=ecg(k);
    end
 
%%%%%% En este bloque acomodamos el filtro
filtro = fliplr(filtro);%%%%%% En este bloque voltemaos el filtro
filtro=filtro-mean(filtro);%%%%%% En este bloque eliminamos el nivel DC del filtro
set(handles.Filtro,'Visible', 'on');
plot(handles.Filtro,tfiltro,filtro);
grid;
 
%%%%%% En este bloque eliminamos el nivel DC de las se�al ecg3
ecgsindc=ecg-mean(ecg);
 
%%%%%% En este bloque generamos el ruido
 
%Se crea un vector de tiempo de 4000 puntos tomados cada milisegundo.
ts=1/4000;
tnoise=0:ts:1-ts;
ws=2e3;
fs=ws/2/pi;
stdnoise=20;
noise=stdnoise*randn(size(tnoise));
 
%%%%%% En este bloque sumamos  la se�al ecg3 sin DC con el ruido 
ecgsindcsucia=ecgsindc+nivelruido.*noise;
set(handles.SplusNoise,'Visible', 'on');
plot(handles.SplusNoise,t,ecgsindcsucia);
grid;
 
%%%%%% En este bloque realizamos la convolucion y graficamos el resultado.
[filtrada,ny2]=ctc(ecgsindcsucia,t,filtro,tfiltro,T);
set(handles.SFiltrada,'Visible', 'on');
plot(handles.SFiltrada,ny2,filtrada);
 
 
end
 
if opcion==3
 
T=1/1000;
t=0:0.001:1-0.001;
t1=0:0.001:7-0.001;
 
%%%%%% En este bloque generamos la se�al requerida
y=[chirp(t,0,1,150) zeros(1,2000) (3/4).*chirp(t,0,1,150) zeros(1,2000) (1/2).*chirp(t,0,1,150)] ;
set(handles.SOriginal,'Visible', 'on');
plot(handles.SOriginal,t1,y);
 
%%%%%% En este bloque generamos el ruido 
ts=1e-4;
tnoise=0:1/7000:1-1/7000;
stdnoise=50e-3;
noise=stdnoise*randn(size(tnoise));
 
%%%%%% En este bloque sumamos la se�al requerida con el ruido
chirpsucia=y+nivelruido.*noise;
set(handles.SplusNoise,'Visible', 'on');
plot(handles.SplusNoise,t1,chirpsucia);
 
%%%%% En este bloque generamos el filtro
c=chirp(t,0,1,150);
tfiltro=0:0.001:1-0.001;
filtro=fliplr(c);
set(handles.Filtro,'Visible', 'on');
plot(handles.Filtro,tfiltro,filtro);
 
%%%%%% En este bloque realizamos la convolucion y graficamos el resultado
[filtrada,ny2]=ctc(chirpsucia,t1,filtro,tfiltro,T);
set(handles.SFiltrada,'Visible', 'on');
plot(handles.SFiltrada,ny2,filtrada);
 
end
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder