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

% Last Modified by GUIDE v2.5 02-Aug-2011 08:00:22

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

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = Tabelle_mit_Logical_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;


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

%Windows-Explorer öffenen!
[xlsfile,path2xls] = uigetfile ('*.xls', 'Bitte wählen');
%Einlesen der Excel-Tabelle!
rawdata1 = xlsread(fullfile(path2xls,xlsfile));                            

%Anzahl der Zeilen und Spalten bestimmen
size_rawdata1 = size(rawdata1);
fprintf('Zeilen %.f \n', size_rawdata1(:,1));
fprintf('Splaten %.f \n', size_rawdata1(:,2));

%Definition der Tabelle
%columnformat(data(:,1)) = {'logical'};

%Abfrage-Vektor erzeugen
for i = 1:size_rawdata1(:,1)+1;
    columnformat(1,i)={'numeric'};
end
columnformat(1,1) = {'logical'};
for i = 1:size_rawdata1(:,1)
    data_abfrage(i,1) = {'true'};
end
 
%in cell umwandeln
%tabelle1 = num2cell (rawdata1);

%Daten für Tabelle erzuegen
%data = {data_abfrage, tabelle1};
%data = cell2mat(h_1);

%Daten in Tabelle schreiben
set(handles.tabelle1,'ColumnFormat', columnformat, ...
    'data', {data_abfrage, rawdata1});


% --- Executes when entered data in editable cell(s) in tabelle1.
function tabelle1_CellEditCallback(hObject, eventdata, handles)
% hObject    handle to tabelle1 (see GCBO)
% eventdata  structure with the following fields (see UITABLE)
%	Indices: row and column indices of the cell(s) edited
%	PreviousData: previous data for the cell(s) edited
%	EditData: string(s) entered by the user
%	NewData: EditData or its converted form set on the Data property. Empty if Data was not changed
%	Error: error string when failed to convert EditData to appropriate value for Data
% handles    structure with handles and user data (see GUIDATA)

%Daten bekommen
data = get (hObject, 'data');
spalte1 = (data(:,1));
%fprintf('Abfrage %.f \n',spalte1);

%Daten beareiten

data1 = data(1,:);
plot (data1);
disp(sum(data));
