Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.98 KB | None | 0 0
  1. function varargout = untitledguido(varargin)
  2. % UNTITLEDGUIDO MATLAB code for untitledguido.fig
  3. % UNTITLEDGUIDO, by itself, creates a new UNTITLEDGUIDO or raises the existing
  4. % singleton*.
  5. %
  6. % H = UNTITLEDGUIDO returns the handle to a new UNTITLEDGUIDO or the handle to
  7. % the existing singleton*.
  8. %
  9. % UNTITLEDGUIDO('CALLBACK',hObject,eventData,handles,...) calls the local
  10. % function named CALLBACK in UNTITLEDGUIDO.M with the given input arguments.
  11. %
  12. % UNTITLEDGUIDO('Property','Value',...) creates a new UNTITLEDGUIDO or raises the
  13. % existing singleton*. Starting from the left, property value pairs are
  14. % applied to the GUI before untitledguido_OpeningFcn gets called. An
  15. % unrecognized property name or invalid value makes property application
  16. % stop. All inputs are passed to untitledguido_OpeningFcn via varargin.
  17. %
  18. % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
  19. % instance to run (singleton)".
  20. %
  21. % See also: GUIDE, GUIDATA, GUIHANDLES
  22.  
  23. % Edit the above text to modify the response to help untitledguido
  24.  
  25. % Last Modified by GUIDE v2.5 02-Dec-2016 20:11:01
  26.  
  27. % Begin initialization code - DO NOT EDIT
  28. gui_Singleton = 1;
  29. gui_State = struct('gui_Name', mfilename, ...
  30. 'gui_Singleton', gui_Singleton, ...
  31. 'gui_OpeningFcn', @untitledguido_OpeningFcn, ...
  32. 'gui_OutputFcn', @untitledguido_OutputFcn, ...
  33. 'gui_LayoutFcn', [] , ...
  34. 'gui_Callback', []);
  35. if nargin && ischar(varargin{1})
  36. gui_State.gui_Callback = str2func(varargin{1});
  37. end
  38.  
  39. if nargout
  40. [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
  41. else
  42. gui_mainfcn(gui_State, varargin{:});
  43. end
  44. % End initialization code - DO NOT EDIT
  45.  
  46. % --- Executes just before untitledguido is made visible.
  47.  
  48.  
  49. function untitledguido_OpeningFcn(hObject, eventdata, handles, varargin)
  50. % This function has no output args, see OutputFcn.
  51. % hObject handle to figure
  52. % eventdata reserved - to be defined in a future version of MATLAB
  53. % handles structure with handles and user data (see GUIDATA)
  54. % varargin command line arguments to untitledguido (see VARARGIN)
  55.  
  56. % Choose default command line output for untitledguido
  57. handles.output = hObject;
  58.  
  59. % Update handles structure
  60. guidata(hObject, handles);
  61.  
  62. % UIWAIT makes untitledguido wait for user response (see UIRESUME)
  63. % uiwait(handles.figure1);
  64.  
  65.  
  66.  
  67. addpath(genpath('C:\Users\Anna\Documents\MATLAB\Szakdoga'))
  68.  
  69. global bodydance; %A beolvasott random mozgás
  70. global transform; %A kov. mtx. két legnagyobb sajátértékéhez tartozó sajátvektor
  71. [~, bodydance] = readNprocess('rand1.zba',5);
  72. transform = PCA(bodydance);
  73.  
  74. global signal; % A vizsgált jel
  75. global time; %Az ehhez tartozó idő
  76. global from; %Az idő hányadik elemétől vizsgáljuk
  77. global to; %Az idő hányadik eleméig vizsgáljuk
  78. [time, signal] = readNprocess('rand2.zba',5);
  79. from = 1;
  80. to = size(signal,1);
  81.  
  82. global h;
  83. h = signal * transform;
  84.  
  85.  
  86. %A plotcsatornákat tároló vektor, a könnyebb elérés érdekében
  87. global channels;
  88. channels = [handles.CH1, handles.CH2, handles.CH3, handles.CH4, ...
  89. handles.CH5, handles.CH6, handles.CH7, handles.CH8];
  90.  
  91. %A pozíciógörgő inicializálása
  92. set (handles.Position,'Max', to);
  93. set (handles.Position,'Min', from);
  94. set (handles.Position,'Value', from);
  95. set (handles.Position,'SliderStep',[ 1/(to-from), 1/100 ]);
  96.  
  97. %A legördülő menük inicializálása
  98. value = 1:3;
  99. value = num2str(value');
  100. set(handles.Subjects, 'String', value);
  101.  
  102. value = 1:4;
  103. value = num2str(value');
  104. set(handles.Bodydance, 'String', value);
  105.  
  106.  
  107.  
  108. global plots; % A *-ok kirajzolását elérő vektor, az alőző *-ok törlése végett
  109.  
  110. %A jel kirajzolása
  111. plotSignal(handles);
  112.  
  113.  
  114. %A *-ok 1. kirajzolása
  115. plotAktuel(handles);
  116.  
  117. global started;
  118. started = 1;
  119.  
  120. function plotSignal(handles)
  121. %plotolja az akktuális jelet
  122.  
  123. global signal;
  124. global time;
  125. global from;
  126. global to;
  127. global channels;
  128. global plots;
  129.  
  130. for i = 1:8
  131. axes(channels(i));
  132. plot(channels(i),time(from:to),signal(from:to,i));
  133. axis([time(from),time(to),-1000,1000]);
  134. axis 'auto y';
  135. %axis auto
  136. xlabel('Time (s)');
  137. ylabel('Amplitude (mV)');
  138. hold on
  139. plots(i) = plot(channels(i),0,0,'r*');
  140. hold off
  141.  
  142. end
  143.  
  144. %A *-ok 0. kirajzolása, hogy a későbbiekben a delete ne fagyjon ki
  145.  
  146. % plot(handles.Cursor,h(a,1),h(a,2),'r*');
  147.  
  148. function plotAktuel(handles)
  149. %plotolja az akktuális jelet
  150.  
  151. global signal;
  152. global time;
  153. global channels;
  154. global h;
  155. global plots;
  156. a = round(get(handles.Position,'Value'));
  157.  
  158. for i = 1:8
  159. axes(channels(i));
  160. hold on;
  161. delete(plots(i));
  162. plots(i) = plot(channels(i), time(a), signal(a,i), 'r*');
  163. xlabel('Time (s)');
  164. ylabel('Amplitude (mV)');
  165. hold off;
  166. end
  167. axes(handles.Cursor);
  168. global con;
  169. if con
  170. hold on;
  171. end
  172. plot(handles.Cursor,h(a,1),h(a,2),'r*');
  173. axis([-200,200,-200,200]);
  174. hold off;
  175.  
  176. % --- Outputs from this function are returned to the command line.
  177. function varargout = untitledguido_OutputFcn(hObject, eventdata, handles)
  178. % varargout cell array for returning output args (see VARARGOUT);
  179. % hObject handle to figure
  180. % eventdata reserved - to be defined in a future version of MATLAB
  181. % handles structure with handles and user data (see GUIDATA)
  182.  
  183. % Get default command line output from handles structure
  184. varargout{1} = handles.output;
  185.  
  186.  
  187. % --- Executes on slider movement.
  188. function Position_Callback(hObject, eventdata, handles)
  189. % hObject handle to Position (see GCBO)
  190. % eventdata reserved - to be defined in a future version of MATLAB
  191. % handles structure with handles and user data (see GUIDATA)
  192.  
  193. % Hints: get(hObject,'Value') returns position of slider
  194. % get(hObject,'Min') and get(hObject,'Max') to determine range of slider
  195.  
  196. val = round(get(hObject, 'Value')*10/9);
  197. val = num2str(val);
  198. set(handles.time, 'String', val);
  199.  
  200. plotAktuel(handles);
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208. % --- Executes during object creation, after setting all properties.
  209. function Position_CreateFcn(hObject, eventdata, handles)
  210. % hObject handle to Position (see GCBO)
  211. % eventdata reserved - to be defined in a future version of MATLAB
  212. % handles empty - handles not created until after all CreateFcns called
  213.  
  214. % Hint: slider controls usually have a light gray background.
  215. if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  216. set(hObject,'BackgroundColor',[.9 .9 .9]);
  217. end
  218.  
  219.  
  220. % --- Executes on button press in Refresh.
  221. function Refresh_Callback(hObject, eventdata, handles)
  222. % hObject handle to Refresh (see GCBO)
  223. % eventdata reserved - to be defined in a future version of MATLAB
  224. % handles structure with handles and user data (see GUIDATA)
  225. global from;
  226. global to;
  227. from = round(str2double(get(handles.From,'String')));
  228. to = round(str2double(get(handles.To,'String')));
  229.  
  230. set(handles.Position,'Min', from );
  231. set(handles.Position,'Max', to);
  232. set (handles.Position,'Value', from);
  233. set (handles.Position,'SliderStep',[ 1/(to-from), 1/100 ]);
  234.  
  235. global con;
  236. con = get(handles.doRMS,'Value');
  237.  
  238.  
  239. plotSignal();
  240. plotAktuel(handles);
  241.  
  242. % --- Executes on button press in Process.
  243. function Process_Callback(hObject, eventdata, handles)
  244. % hObject handle to Process (see GCBO)
  245. % eventdata reserved - to be defined in a future version of MATLAB
  246. % handles structure with handles and user data (see GUIDATA)
  247.  
  248.  
  249. p = 20;
  250. global channels;
  251. global bodydance; %A beolvasott random mozgás
  252. global transform; %A kov. mtx. két legnagyobb sajátértékéhez tartozó sajátvektor
  253. bodydance = RMSMtx(bodydance,p)
  254. transform = PCA(bodydance)
  255.  
  256. global signal; % A vizsgált jel
  257. signal = RMSMtx(signal,p);
  258.  
  259. global h;
  260. h = signal * transform;
  261.  
  262. plotSignal(handles);
  263. plotAktuel(handles);
  264.  
  265.  
  266.  
  267.  
  268. % --- Executes on button press in Run.
  269. function Run_Callback(hObject, eventdata, handles)
  270. % hObject handle to Run (see GCBO)
  271. % eventdata reserved - to be defined in a future version of MATLAB
  272. % handles structure with handles and user data (see GUIDATA)
  273. global actuel;
  274. global from;
  275. global to;
  276. for i = from:2:to
  277. actuel = i;
  278. set(handles.Position,'Value',i);
  279. plotAktuel(handles);
  280. end
  281.  
  282.  
  283.  
  284. % --- Executes on button press in change_bd.
  285. function change_bd_Callback(hObject, eventdata, handles)
  286. % hObject handle to change_bd (see GCBO)
  287. % eventdata reserved - to be defined in a future version of MATLAB
  288. % handles structure with handles and user data (see GUIDATA)
  289.  
  290. s = get(handles.bodydance,'Value');
  291. s = ['rand' s '.zba'];
  292. global bodydance; %A beolvasott random mozgás
  293. global transform; %A kov. mtx. két legnagyobb sajátértékéhez tartozó sajátvektor
  294. [~, bodydance] = loadbd(s);
  295. transform = PCA(bodydance);
  296.  
  297.  
  298.  
  299.  
  300. % --- Executes on button press in change_signal.
  301. function change_signal_Callback(hObject, eventdata, handles)
  302. % hObject handle to change_signal (see GCBO)
  303. % eventdata reserved - to be defined in a future version of MATLAB
  304. % handles structure with handles and user data (see GUIDATA)
  305.  
  306. i = get(handles.Signal,'Value');
  307. s = get(handles.Signal,'String');
  308. s = strcat(s{i}, '.zba')
  309. s2 = 'sifut.zba'
  310. global signal; % A vizsgált jel
  311. global time; %Az ehhez tartozó idő
  312. global from; %Az idő hányadik elemétől vizsgáljuk
  313. global to; %Az idő hányadik eleméig vizsgáljuk
  314. [time, signal] = loadbd(s);
  315. from = 1;
  316. to = size(signal,1);
  317.  
  318. global transform;
  319. global h;
  320. h = signal * transform;
  321.  
  322. global channels;
  323. global plots;
  324.  
  325. plotSignal(handles);
  326. plotAktuel(handles);
  327.  
  328.  
  329.  
  330.  
  331. function To_Callback(hObject, eventdata, handles)
  332. % hObject handle to To (see GCBO)
  333. % eventdata reserved - to be defined in a future version of MATLAB
  334. % handles structure with handles and user data (see GUIDATA)
  335.  
  336. % Hints: get(hObject,'String') returns contents of To as text
  337. % str2double(get(hObject,'String')) returns contents of To as a double
  338.  
  339.  
  340. % --- Executes during object creation, after setting all properties.
  341. function To_CreateFcn(hObject, eventdata, handles)
  342. % hObject handle to To (see GCBO)
  343. % eventdata reserved - to be defined in a future version of MATLAB
  344. % handles empty - handles not created until after all CreateFcns called
  345.  
  346. % Hint: edit controls usually have a white background on Windows.
  347. % See ISPC and COMPUTER.
  348. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  349. set(hObject,'BackgroundColor','white');
  350. end
  351.  
  352.  
  353.  
  354. function From_Callback(hObject, eventdata, handles)
  355. % hObject handle to From (see GCBO)
  356. % eventdata reserved - to be defined in a future version of MATLAB
  357. % handles structure with handles and user data (see GUIDATA)
  358.  
  359. % Hints: get(hObject,'String') returns contents of From as text
  360. % str2double(get(hObject,'String')) returns contents of From as a double
  361.  
  362.  
  363. % --- Executes during object creation, after setting all properties.
  364. function From_CreateFcn(hObject, eventdata, handles)
  365. % hObject handle to From (see GCBO)
  366. % eventdata reserved - to be defined in a future version of MATLAB
  367. % handles empty - handles not created until after all CreateFcns called
  368.  
  369. % Hint: edit controls usually have a white background on Windows.
  370. % See ISPC and COMPUTER.
  371. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  372. set(hObject,'BackgroundColor','white');
  373. end
  374.  
  375.  
  376.  
  377. function lb_Callback(hObject, eventdata, handles)
  378. % hObject handle to lb (see GCBO)
  379. % eventdata reserved - to be defined in a future version of MATLAB
  380. % handles structure with handles and user data (see GUIDATA)
  381.  
  382. % Hints: get(hObject,'String') returns contents of lb as text
  383. % str2double(get(hObject,'String')) returns contents of lb as a double
  384.  
  385.  
  386. % --- Executes during object creation, after setting all properties.
  387. function lb_CreateFcn(hObject, eventdata, handles)
  388. % hObject handle to lb (see GCBO)
  389. % eventdata reserved - to be defined in a future version of MATLAB
  390. % handles empty - handles not created until after all CreateFcns called
  391.  
  392. % Hint: edit controls usually have a white background on Windows.
  393. % See ISPC and COMPUTER.
  394. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  395. set(hObject,'BackgroundColor','white');
  396. end
  397.  
  398.  
  399. % --- Executes on button press in change_subject.
  400. function change_subject_Callback(hObject, eventdata, handles)
  401. % hObject handle to change_subject (see GCBO)
  402. % eventdata reserved - to be defined in a future version of MATLAB
  403. % handles structure with handles and user data (see GUIDATA)
  404.  
  405.  
  406.  
  407.  
  408. % --- Executes on selection change_signal in Subjects.
  409. function Subjects_Callback(hObject, eventdata, handles)
  410. % hObject handle to Subjects (see GCBO)
  411. % eventdata reserved - to be defined in a future version of MATLAB
  412. % handles structure with handles and user data (see GUIDATA)
  413.  
  414. % Hints: contents = cellstr(get(hObject,'String')) returns Subjects contents as cell array
  415. % contents{get(hObject,'Value')} returns selected item from Subjects
  416.  
  417.  
  418. % --- Executes during object creation, after setting all properties.
  419. function Subjects_CreateFcn(hObject, eventdata, handles)
  420. % hObject handle to Subjects (see GCBO)
  421. % eventdata reserved - to be defined in a future version of MATLAB
  422. % handles empty - handles not created until after all CreateFcns called
  423.  
  424. % Hint: popupmenu controls usually have a white background on Windows.
  425. % See ISPC and COMPUTER.
  426. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  427. set(hObject,'BackgroundColor','white');
  428. end
  429.  
  430.  
  431. % --- Executes on button press in checkbox1.
  432. function checkbox1_Callback(hObject, eventdata, handles)
  433. % hObject handle to checkbox1 (see GCBO)
  434. % eventdata reserved - to be defined in a future version of MATLAB
  435. % handles structure with handles and user data (see GUIDATA)
  436.  
  437. % Hint: get(hObject,'Value') returns toggle state of checkbox1
  438.  
  439.  
  440. % --- Executes on button press in checkbox2.
  441. function checkbox2_Callback(hObject, eventdata, handles)
  442. % hObject handle to checkbox2 (see GCBO)
  443. % eventdata reserved - to be defined in a future version of MATLAB
  444. % handles structure with handles and user data (see GUIDATA)
  445.  
  446. % Hint: get(hObject,'Value') returns toggle state of checkbox2
  447.  
  448.  
  449. % --- Executes on button press in checkbox3.
  450. function checkbox3_Callback(hObject, eventdata, handles)
  451. % hObject handle to checkbox3 (see GCBO)
  452. % eventdata reserved - to be defined in a future version of MATLAB
  453. % handles structure with handles and user data (see GUIDATA)
  454.  
  455. % Hint: get(hObject,'Value') returns toggle state of checkbox3
  456.  
  457.  
  458. % --- Executes on button press in checkbox4.
  459. function checkbox4_Callback(hObject, eventdata, handles)
  460. % hObject handle to checkbox4 (see GCBO)
  461. % eventdata reserved - to be defined in a future version of MATLAB
  462. % handles structure with handles and user data (see GUIDATA)
  463.  
  464. % Hint: get(hObject,'Value') returns toggle state of checkbox4
  465.  
  466.  
  467. % --- Executes on button press in checkbox5.
  468. function checkbox5_Callback(hObject, eventdata, handles)
  469. % hObject handle to checkbox5 (see GCBO)
  470. % eventdata reserved - to be defined in a future version of MATLAB
  471. % handles structure with handles and user data (see GUIDATA)
  472.  
  473. % Hint: get(hObject,'Value') returns toggle state of checkbox5
  474.  
  475.  
  476. % --- Executes on button press in checkbox6.
  477. function checkbox6_Callback(hObject, eventdata, handles)
  478. % hObject handle to checkbox6 (see GCBO)
  479. % eventdata reserved - to be defined in a future version of MATLAB
  480. % handles structure with handles and user data (see GUIDATA)
  481.  
  482. % Hint: get(hObject,'Value') returns toggle state of checkbox6
  483.  
  484.  
  485. % --- Executes on button press in checkbox7.
  486. function checkbox7_Callback(hObject, eventdata, handles)
  487. % hObject handle to checkbox7 (see GCBO)
  488. % eventdata reserved - to be defined in a future version of MATLAB
  489. % handles structure with handles and user data (see GUIDATA)
  490.  
  491. % Hint: get(hObject,'Value') returns toggle state of checkbox7
  492.  
  493.  
  494. % --- Executes on button press in checkbox8.
  495. function checkbox8_Callback(hObject, eventdata, handles)
  496. % hObject handle to checkbox8 (see GCBO)
  497. % eventdata reserved - to be defined in a future version of MATLAB
  498. % handles structure with handles and user data (see GUIDATA)
  499.  
  500. % Hint: get(hObject,'Value') returns toggle state of checkbox8
  501.  
  502.  
  503. % --- Executes on selection change_signal in Bodydance.
  504. function Bodydance_Callback(hObject, eventdata, handles)
  505. % hObject handle to Bodydance (see GCBO)
  506. % eventdata reserved - to be defined in a future version of MATLAB
  507. % handles structure with handles and user data (see GUIDATA)
  508.  
  509. % Hints: contents = cellstr(get(hObject,'String')) returns Bodydance contents as cell array
  510. % contents{get(hObject,'Value')} returns selected item from Bodydance
  511.  
  512.  
  513. % --- Executes during object creation, after setting all properties.
  514. function Bodydance_CreateFcn(hObject, eventdata, handles)
  515. % hObject handle to Bodydance (see GCBO)
  516. % eventdata reserved - to be defined in a future version of MATLAB
  517. % handles empty - handles not created until after all CreateFcns called
  518.  
  519. % Hint: popupmenu controls usually have a white background on Windows.
  520. % See ISPC and COMPUTER.
  521. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  522. set(hObject,'BackgroundColor','white');
  523. end
  524.  
  525.  
  526. % --- Executes on selection change_signal in Signal.
  527. function Signal_Callback(hObject, eventdata, handles)
  528. % hObject handle to Signal (see GCBO)
  529. % eventdata reserved - to be defined in a future version of MATLAB
  530. % handles structure with handles and user data (see GUIDATA)
  531.  
  532. % Hints: contents = cellstr(get(hObject,'String')) returns Signal contents as cell array
  533. % contents{get(hObject,'Value')} returns selected item from Signal
  534.  
  535.  
  536. % --- Executes during object creation, after setting all properties.
  537. function Signal_CreateFcn(hObject, eventdata, handles)
  538. % hObject handle to Signal (see GCBO)
  539. % eventdata reserved - to be defined in a future version of MATLAB
  540. % handles empty - handles not created until after all CreateFcns called
  541.  
  542. % Hint: popupmenu controls usually have a white background on Windows.
  543. % See ISPC and COMPUTER.
  544. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  545. set(hObject,'BackgroundColor','white');
  546. end
  547.  
  548.  
  549. % --- Executes on button press in Bandpass.
  550. function Bandpass_Callback(hObject, eventdata, handles)
  551. % hObject handle to Bandpass (see GCBO)
  552. % eventdata reserved - to be defined in a future version of MATLAB
  553. % handles structure with handles and user data (see GUIDATA)
  554.  
  555. % Hint: get(hObject,'Value') returns toggle state of Bandpass
  556.  
  557.  
  558. % --- Executes on button press in doRMS.
  559. function doRMS_Callback(hObject, eventdata, handles)
  560. % hObject handle to doRMS (see GCBO)
  561. % eventdata reserved - to be defined in a future version of MATLAB
  562. % handles structure with handles and user data (see GUIDATA)
  563.  
  564. % Hint: get(hObject,'Value') returns toggle state of doRMS
  565.  
  566.  
  567.  
  568.  
  569. function time_Callback(hObject, eventdata, handles)
  570. % hObject handle to time (see GCBO)
  571. % eventdata reserved - to be defined in a future version of MATLAB
  572. % handles structure with handles and user data (see GUIDATA)
  573.  
  574. % Hints: get(hObject,'String') returns contents of time as text
  575. % str2double(get(hObject,'String')) returns contents of time as a double
  576.  
  577.  
  578. % --- Executes during object creation, after setting all properties.
  579. function time_CreateFcn(hObject, eventdata, handles)
  580. % hObject handle to time (see GCBO)
  581. % eventdata reserved - to be defined in a future version of MATLAB
  582. % handles empty - handles not created until after all CreateFcns called
  583.  
  584. % Hint: edit controls usually have a white background on Windows.
  585. % See ISPC and COMPUTER.
  586. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  587. set(hObject,'BackgroundColor','white');
  588. end
  589.  
  590.  
  591.  
  592. % --- Executes on button press in setFrom.
  593. function setFrom_Callback(hObject, eventdata, handles)
  594. % hObject handle to setFrom (see GCBO)
  595. % eventdata reserved - to be defined in a future version of MATLAB
  596. % handles structure with handles and user data (see GUIDATA)
  597. val = get(handles.time, 'String');
  598. set(handles.From, 'String', val);
  599. valnumF = str2double(val);
  600. valnumT = str2double(get(handles.To, 'String'));
  601.  
  602. if valnumF > valnumT
  603. set(handles.To, 'String', val);
  604. end
  605.  
  606.  
  607.  
  608. % --- Executes on button press in setTo.
  609. function setTo_Callback(hObject, eventdata, handles)
  610. % hObject handle to setTo (see GCBO)
  611. % eventdata reserved - to be defined in a future version of MATLAB
  612. % handles structure with handles and user data (see GUIDATA)
  613. val = get(handles.time, 'String');
  614. set(handles.To, 'String', val);
  615. valnumT = str2double(val);
  616. valnumF = str2double(get(handles.From, 'String'));
  617.  
  618. if valnumF > valnumT
  619. set(handles.From, 'String', val);
  620. end
  621.  
  622. % --- Executes on button press in plotInterval.
  623. function plotInterval_Callback(hObject, eventdata, handles)
  624. % hObject handle to plotInterval (see GCBO)
  625. % eventdata reserved - to be defined in a future version of MATLAB
  626. % handles structure with handles and user data (see GUIDATA)
  627. global time;
  628. global h;
  629. from = ms2n(str2double(get(handles.From, 'String')));
  630. to = ms2n(str2double(get(handles.To, 'String')));
  631. plot (handles.Cursor, h(from:to,1), h(from:to,2), 'r-');
  632.  
  633.  
  634.  
  635.  
  636. % --- Executes on button press in LED.
  637. function LED_Callback(hObject, eventdata, handles)
  638. % hObject handle to LED (see GCBO)
  639. % eventdata reserved - to be defined in a future version of MATLAB
  640. % handles structure with handles and user data (see GUIDATA)
  641.  
  642. % Hint: get(hObject,'Value') returns toggle state of LED
  643.  
  644.  
  645. % --- Executes on button press in checkbox12.
  646. function checkbox12_Callback(hObject, eventdata, handles)
  647. % hObject handle to checkbox12 (see GCBO)
  648. % eventdata reserved - to be defined in a future version of MATLAB
  649. % handles structure with handles and user data (see GUIDATA)
  650.  
  651. % Hint: get(hObject,'Value') returns toggle state of checkbox12
  652.  
  653.  
  654. % --- Executes on button press in absolute.
  655. function absolute_Callback(hObject, eventdata, handles)
  656. % hObject handle to absolute (see GCBO)
  657. % eventdata reserved - to be defined in a future version of MATLAB
  658. % handles structure with handles and user data (see GUIDATA)
  659.  
  660. % Hint: get(hObject,'Value') returns toggle state of absolute
  661.  
  662.  
  663. % --- Executes on button press in Relative.
  664. function Relative_Callback(hObject, eventdata, handles)
  665. % hObject handle to Relative (see GCBO)
  666. % eventdata reserved - to be defined in a future version of MATLAB
  667. % handles structure with handles and user data (see GUIDATA)
  668.  
  669. % Hint: get(hObject,'Value') returns toggle state of Relative
  670.  
  671.  
  672.  
  673. function edit6_Callback(hObject, eventdata, handles)
  674. % hObject handle to edit6 (see GCBO)
  675. % eventdata reserved - to be defined in a future version of MATLAB
  676. % handles structure with handles and user data (see GUIDATA)
  677.  
  678. % Hints: get(hObject,'String') returns contents of edit6 as text
  679. % str2double(get(hObject,'String')) returns contents of edit6 as a double
  680.  
  681.  
  682. % --- Executes during object creation, after setting all properties.
  683. function edit6_CreateFcn(hObject, eventdata, handles)
  684. % hObject handle to edit6 (see GCBO)
  685. % eventdata reserved - to be defined in a future version of MATLAB
  686. % handles empty - handles not created until after all CreateFcns called
  687.  
  688. % Hint: edit controls usually have a white background on Windows.
  689. % See ISPC and COMPUTER.
  690. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  691. set(hObject,'BackgroundColor','white');
  692. end
  693.  
  694.  
  695.  
  696. function edit7_Callback(hObject, eventdata, handles)
  697. % hObject handle to edit7 (see GCBO)
  698. % eventdata reserved - to be defined in a future version of MATLAB
  699. % handles structure with handles and user data (see GUIDATA)
  700.  
  701. % Hints: get(hObject,'String') returns contents of edit7 as text
  702. % str2double(get(hObject,'String')) returns contents of edit7 as a double
  703.  
  704.  
  705. % --- Executes during object creation, after setting all properties.
  706. function edit7_CreateFcn(hObject, eventdata, handles)
  707. % hObject handle to edit7 (see GCBO)
  708. % eventdata reserved - to be defined in a future version of MATLAB
  709. % handles empty - handles not created until after all CreateFcns called
  710.  
  711. % Hint: edit controls usually have a white background on Windows.
  712. % See ISPC and COMPUTER.
  713. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  714. set(hObject,'BackgroundColor','white');
  715. end
  716.  
  717.  
  718.  
  719. function edit8_Callback(hObject, eventdata, handles)
  720. % hObject handle to edit8 (see GCBO)
  721. % eventdata reserved - to be defined in a future version of MATLAB
  722. % handles structure with handles and user data (see GUIDATA)
  723.  
  724. % Hints: get(hObject,'String') returns contents of edit8 as text
  725. % str2double(get(hObject,'String')) returns contents of edit8 as a double
  726.  
  727.  
  728. % --- Executes during object creation, after setting all properties.
  729. function edit8_CreateFcn(hObject, eventdata, handles)
  730. % hObject handle to edit8 (see GCBO)
  731. % eventdata reserved - to be defined in a future version of MATLAB
  732. % handles empty - handles not created until after all CreateFcns called
  733.  
  734. % Hint: edit controls usually have a white background on Windows.
  735. % See ISPC and COMPUTER.
  736. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  737. set(hObject,'BackgroundColor','white');
  738. end
  739.  
  740.  
  741.  
  742. function edit10_Callback(hObject, eventdata, handles)
  743. % hObject handle to edit10 (see GCBO)
  744. % eventdata reserved - to be defined in a future version of MATLAB
  745. % handles structure with handles and user data (see GUIDATA)
  746.  
  747. % Hints: get(hObject,'String') returns contents of edit10 as text
  748. % str2double(get(hObject,'String')) returns contents of edit10 as a double
  749.  
  750.  
  751. % --- Executes during object creation, after setting all properties.
  752. function edit10_CreateFcn(hObject, eventdata, handles)
  753. % hObject handle to edit10 (see GCBO)
  754. % eventdata reserved - to be defined in a future version of MATLAB
  755. % handles empty - handles not created until after all CreateFcns called
  756.  
  757. % Hint: edit controls usually have a white background on Windows.
  758. % See ISPC and COMPUTER.
  759. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  760. set(hObject,'BackgroundColor','white');
  761. end
  762.  
  763.  
  764.  
  765. function edit11_Callback(hObject, eventdata, handles)
  766. % hObject handle to edit11 (see GCBO)
  767. % eventdata reserved - to be defined in a future version of MATLAB
  768. % handles structure with handles and user data (see GUIDATA)
  769.  
  770. % Hints: get(hObject,'String') returns contents of edit11 as text
  771. % str2double(get(hObject,'String')) returns contents of edit11 as a double
  772.  
  773.  
  774. % --- Executes during object creation, after setting all properties.
  775. function edit11_CreateFcn(hObject, eventdata, handles)
  776. % hObject handle to edit11 (see GCBO)
  777. % eventdata reserved - to be defined in a future version of MATLAB
  778. % handles empty - handles not created until after all CreateFcns called
  779.  
  780. % Hint: edit controls usually have a white background on Windows.
  781. % See ISPC and COMPUTER.
  782. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  783. set(hObject,'BackgroundColor','white');
  784. end
  785.  
  786.  
  787.  
  788. function edit12_Callback(hObject, eventdata, handles)
  789. % hObject handle to edit12 (see GCBO)
  790. % eventdata reserved - to be defined in a future version of MATLAB
  791. % handles structure with handles and user data (see GUIDATA)
  792.  
  793. % Hints: get(hObject,'String') returns contents of edit12 as text
  794. % str2double(get(hObject,'String')) returns contents of edit12 as a double
  795.  
  796.  
  797. % --- Executes during object creation, after setting all properties.
  798. function edit12_CreateFcn(hObject, eventdata, handles)
  799. % hObject handle to edit12 (see GCBO)
  800. % eventdata reserved - to be defined in a future version of MATLAB
  801. % handles empty - handles not created until after all CreateFcns called
  802.  
  803. % Hint: edit controls usually have a white background on Windows.
  804. % See ISPC and COMPUTER.
  805. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  806. set(hObject,'BackgroundColor','white');
  807. end
  808.  
  809.  
  810.  
  811. function edit13_Callback(hObject, eventdata, handles)
  812. % hObject handle to edit13 (see GCBO)
  813. % eventdata reserved - to be defined in a future version of MATLAB
  814. % handles structure with handles and user data (see GUIDATA)
  815.  
  816. % Hints: get(hObject,'String') returns contents of edit13 as text
  817. % str2double(get(hObject,'String')) returns contents of edit13 as a double
  818.  
  819.  
  820. % --- Executes during object creation, after setting all properties.
  821. function edit13_CreateFcn(hObject, eventdata, handles)
  822. % hObject handle to edit13 (see GCBO)
  823. % eventdata reserved - to be defined in a future version of MATLAB
  824. % handles empty - handles not created until after all CreateFcns called
  825.  
  826. % Hint: edit controls usually have a white background on Windows.
  827. % See ISPC and COMPUTER.
  828. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
  829. set(hObject,'BackgroundColor','white');
  830. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement