bin gerade da bei eine gui zu schreiben und jetzt bekomme ich folgenden fehler.
??? Error using ==> feval
Undefined command/function 'figure1_CreateFcn'.
Error in ==> gui_mainfcn at 75
feval(varargin{:});
ich kann mich nicht erklären wo dieser herkommt, da ich bis jetzt eigentlich nur dem fig objekte hinzugefügt hab und noch nicht wirklich viel in der .m rumgespielt habe.
ich finde nichtmal figure1 in meinem .m-file. bin ein bisschen ratlos. muss dazu sagen das ich noch nicht so lange matlab mache und mir des tiefere verständnis für guis noch fehlt. wäre net wenn jemand kurz über meinen code gucken könnte. hab die .fig und .m-file mal angehängt.
% --- Executes just before gui_111107 is made visible. function gui_111107_OpeningFcn(hObject, ~, 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 gui_111107 (see VARARGIN)
% Choose default command line output for gui_111107
handles.output = hObject;
% UIWAIT makes gui_111107 wait for user response (see UIRESUME) % uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line. functionvarargout = gui_111107_OutputFcn(hObject, ~, 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 pushbutton1. function pushbutton1_Callback(hObject, ~, handles)% start button % load values of actions into program
gcode_button = checkbox2_Callback;
ani_button = checkbox3_Callback;
dim_button = checkbox4_Callback;
length_button = checkbox5_Callback;
% create scaffold out of entered values
% create calculated scaffold ifisempty(dir(scaffold_name_calc))
%setting up layers
for l=1:length(scaffold)% different layers if scaffold(l).offset_no > 0 % calculate offset
scaffold(l).offset = min(scaffold(l).hspace/(scaffold(l).offset_no+1));
else %if no offset was chosen
scaffold(l).offset = 0;
end% calculate offset % create one layer
scaffold(l).geom_sub = geom_sublayer111107(scaffold(l));
% rotate one layer
scaffold(l).geom_rot = geom_rotation111107(scaffold(l));
% create scaffold
scaffold(l).geom_lay = geom_layers111108(scaffold(l));
if l > 1% not for first layer % connect different layers without hurting scaffold
scaffold(l-1).geom_lay = greenline_struct111107(scaffold(l-1).geom_lay, ...
scaffold(l).geom_lay,scaffold(l-1).stage_dim, scaffold(l-1).FRbi);
end% connect scaffolds end% different layers save(scaffold_name_calc, 'scaffold'); % save variable for later use else% if already existing load(scaffold_name_calc);
end %layers
% start calculating if gcode_button % create GCode
fid = fopen(['gcode', p_o_n,'.inp'],'wt'); %open new file
for l=1:length(scaffold)-1% different layers % save scaffold as Gcode
gcode = write_gcode(fid,scaffold(l).geom_lay);
end fclose(fid); % close the file which contains the gcode disp(gcode); % gcode has been finished end% GCode
if ani_button % create animation % create movie ifisempty(dir(movie_name))
mov_cell = cell(length(scaffold),1);
for l=1:length(scaffold)% different layers
mov_cell{l} = movie_frame_2color(scaffold(l));
end% different layers save(movie_name,'mov_cell');
closeall;
else% if already saved load(movie_name);
end; % movie end% animation
if length_button % calculate length - ratio % calculate useful length/material, give out percentage ifisempty(dir(scaffold_name_calc_poly)) % polygon calculation and drawing
scaffold = polygon_calc(scaffold);
% calculate useful length/material
scaffold = calc_length111108(scaffold);
% save scaffold save(scaffold_name_calc_poly, 'scaffold');
else load(scaffold_name_calc_poly);
end % draw polygon into structure
poL = line(scaffold(end).geom_lay(:,1),scaffold(end).geom_lay(:,2));
set(poL,'Color', 'y','LineWidth',3);
% display useful property vs. whole property disp(['Useful length vs. wholelengthis', num2str(scaffold(end).prozent_length),' %.' ]);
disp(['Useful material vs. wholematerialis', num2str(scaffold(end).prozent_material),' %.' ]);
end% length
% --- Executes on button press in checkbox1. function[gcode_button, ani_button, dim_button, length_button] = checkbox1_Callback(hObject, ~, ~) ifget(hObject,'Value')
gcode_button = 1;
ani_button = 1;
dim_button = 1;
length_button = 1;
end
% --- Executes on button press in checkbox2. function gcode_button = checkbox2_Callback(hObject, ~, ~)% GCode
gcode_button = get(hObject,'Value');
% --- Executes on button press in checkbox3. function ani_button = checkbox3_Callback(hObject, ~, ~)% animation
ani_button = get(hObject,'Value');
% --- Executes on button press in checkbox4. function dim_button = checkbox4_Callback(hObject, ~, ~)% 3d-view
dim_button = get(hObject,'Value');
% --- Executes on button press in checkbox5. function length_button = checkbox5_Callback(hObject, ~, ~)% length ratio
length_button = get(hObject,'Value');
% --- Executes on selection change in popupmenu1. function[height, max_x] = popupmenu1_Callback(hObject, ~, ~) %height/stage dim
contents = cellstr(get(hObject,'String'));
switch contents
case 'Height'
% save variable as height
height = par1;
case 'Stage dimension'
% calculate height
max_x = par1;
end% switch
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array % contents{get(hObject,'Value')} returns selected item from popupmenu1
% --- Executes during object creation, after setting all properties. function popupmenu1_CreateFcn(hObject, ~, handles) % hObject handle to popupmenu1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function vspace = edit1_Callback(hObject, ~, ~)% vspace
vspace = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit1_CreateFcn(hObject, ~, 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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function FRse = edit2_Callback(hObject, ~, ~) %FRse
FRse = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit2_CreateFcn(hObject, ~, 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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function FRbi = edit3_Callback(hObject, ~, ~)% FRbi
FRbi = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit3_CreateFcn(hObject, ~, 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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function NoLayers = edit4_Callback(hObject, ~, handles)% NoLayers
NoLayers = str2double(get(hObject,'String'));
if NoLayers <= 0 set(handles.edit4_Callback,'ForegroundColor','r');
drawnow;
end
% --- Executes during object creation, after setting all properties. function edit4_CreateFcn(hObject, ~, 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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function par1 = edit5_Callback(hObject, ~, ~)% height/stage dim
par1 = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit5_CreateFcn(hObject, ~, 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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function p_o_n = edit6_Callback(hObject, ~, ~) %part of name
p_o_n = get(hObject,'String');
% --- Executes during object creation, after setting all properties. function edit6_CreateFcn(hObject, ~, 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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function amount = edit7_Callback(hObject, ~, ~)% amount
amount = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit7_CreateFcn(hObject, ~, 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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
% --- Executes during object creation, after setting all properties. function edit8_CreateFcn(hObject, ~, handles) % hObject handle to edit8 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
% --- Executes during object creation, after setting all properties. function edit9_CreateFcn(hObject, ~, handles) % hObject handle to edit9 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function offset = edit10_Callback(hObject, ~, ~)% offset
offset = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit10_CreateFcn(hObject, ~, handles) % hObject handle to edit10 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function No_sub = edit11_Callback(hObject, ~, ~)% No_sub
No_sub = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit11_CreateFcn(hObject, ~, handles) % hObject handle to edit11 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function edit12_Callback(hObject, ~, handles) % hObject handle to edit12 (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 edit12 as text % str2double(get(hObject,'String')) returns contents of edit12 as a double
% --- Executes during object creation, after setting all properties. function edit12_CreateFcn(hObject, ~, handles) % hObject handle to edit12 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function edit13_Callback(hObject, ~, handles) % hObject handle to edit13 (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 edit13 as text % str2double(get(hObject,'String')) returns contents of edit13 as a double
% --- Executes during object creation, after setting all properties. function edit13_CreateFcn(hObject, ~, handles) % hObject handle to edit13 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function edit14_Callback(hObject, ~, handles) % hObject handle to edit14 (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 edit14 as text % str2double(get(hObject,'String')) returns contents of edit14 as a double
% --- Executes during object creation, after setting all properties. function edit14_CreateFcn(hObject, ~, handles) % hObject handle to edit14 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function width = edit15_Callback(hObject, ~, ~)% width
width = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit15_CreateFcn(hObject, ~, handles) % hObject handle to edit15 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function hspace = edit16_Callback(hObject, ~, ~)% hspace
hspace = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit16_CreateFcn(hObject, ~, handles) % hObject handle to edit16 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function FRle = edit17_Callback(hObject, ~, ~)% FRle
FRle = str2double(get(hObject,'String'));
% --- Executes during object creation, after setting all properties. function edit17_CreateFcn(hObject, ~, handles) % hObject handle to edit17 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in checkbox6. function checkbox6_Callback(hObject, eventdata, handles) % hObject handle to checkbox6 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox6
% --- Executes on button press in checkbox7. function checkbox7_Callback(hObject, eventdata, handles) % hObject handle to checkbox7 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox7
% --- Executes on button press in checkbox8. function checkbox8_Callback(hObject, eventdata, handles) % hObject handle to checkbox8 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox8
% --- Executes on button press in checkbox9. function checkbox9_Callback(hObject, eventdata, handles) % hObject handle to checkbox9 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox9
% --- Executes on button press in checkbox10. function checkbox10_Callback(hObject, eventdata, handles) % hObject handle to checkbox10 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of checkbox10
function edit18_Callback(hObject, eventdata, handles) % hObject handle to edit18 (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 edit18 as text % str2double(get(hObject,'String')) returns contents of edit18 as a double
% --- Executes during object creation, after setting all properties. function edit18_CreateFcn(hObject, eventdata, handles) % hObject handle to edit18 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function edit19_Callback(hObject, eventdata, handles) % hObject handle to edit19 (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 edit19 as text % str2double(get(hObject,'String')) returns contents of edit19 as a double
% --- Executes during object creation, after setting all properties. function edit19_CreateFcn(hObject, eventdata, handles) % hObject handle to edit19 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function edit20_Callback(hObject, eventdata, handles) % hObject handle to edit20 (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 edit20 as text % str2double(get(hObject,'String')) returns contents of edit20 as a double
% --- Executes during object creation, after setting all properties. function edit20_CreateFcn(hObject, eventdata, handles) % hObject handle to edit20 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function edit21_Callback(hObject, eventdata, handles) % hObject handle to edit21 (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 edit21 as text % str2double(get(hObject,'String')) returns contents of edit21 as a double
% --- Executes during object creation, after setting all properties. function edit21_CreateFcn(hObject, eventdata, handles) % hObject handle to edit21 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
function edit22_Callback(hObject, eventdata, handles) % hObject handle to edit22 (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 edit22 as text % str2double(get(hObject,'String')) returns contents of edit22 as a double
% --- Executes during object creation, after setting all properties. function edit22_CreateFcn(hObject, eventdata, handles) % hObject handle to edit22 (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. ifispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');
end
Ist ein wenig laenger - aber ich wollte nicht noch mehr loeschen!
Einstellungen und Berechtigungen
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.