Filter löschen
Filter löschen

how to solve font error

19 Ansichten (letzte 30 Tage)
rushi parikh
rushi parikh am 11 Mär. 2023
Beantwortet: Walter Roberson am 11 Mär. 2023
function varargout = ATS(varargin)
% ATS MATLAB code for ATS.fig
% ATS, by itself, creates a new ATS or raises the existing
% singleton*.
%
% H = ATS returns the handle to a new ATS or the handle to
% the existing singleton*.
%
% ATS('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in ATS.M with the given input arguments.
%
% ATS('Property','Value',...) creates a new ATS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before ATS_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to ATS_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 ATS
% Last Modified by GUIDE v2.5 11-Mar-2023 01:36:37
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @ATS_OpeningFcn, ...
'gui_OutputFcn', @ATS_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 ATS is made visible.
function ATS_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 ATS (see VARARGIN)
% Choose default command line output for ATS
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes ATS wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = ATS_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 pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (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,'string');
c = str2num(a);
if(c==25)
%%
cla(handles.axes2)
cla(handles.axes3)
cla(handles.axes5)
cla(handles.axes4)
axes(handles.axes2);
x=.01;y=.01;
Name = 'Enroll no = 12002060501025'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes3);
x=.01;y=.01;
Name = 'Name = Rushi Parikh'
TH= text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes4);
x=.01;y=.01;
Name = 'Father name: Mrunal Parikh'
TH= text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes5);
x=.01;y=.01;
Name = 'Electronics and Communication'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes6);
x=.01;y=.01;
Name = 'semester-6th,year-3rd'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes7);
x=.01;y=.01;
Name = 'Counselor=Kavindra jain, Department Head=Hitesh shah'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes9);
AA=imread(['C:\Users\HP\Pictures\Camera imports\2019-08-18\IMG_20190307_004048_209.jpg'])
imshow(AA);
%
elseif(c==31)
%%
cla(handles.axes2)
cla(handles.axes3)
cla(handles.axes5)
cla(handles.axes4)
axes(handles.axes2);
x=.01;y=.01;
Name = 'Enroll no = 12002060501031'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes3);
x=.01;y=.01;
Name = 'Name = Yogi Suthar'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes4);
x=.01;y=.01;
Name = 'Father name:Harry Suthar'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes5);
x=.01;y=.01;
Name = 'Electronics and Communication'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes6);
x=.01;y=.01;
Name = 'semester-6th,year-3rd'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes7);
x=.01;y=.01;
Name = 'Counselor=Kavindra jain, Department Head=Hitesh shah'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes9);
AA1=imread(['C:\Users\HP\Downloads\YS.jpg'])
imshow(AA1);
%
else
%%
cla(handles.axes2)
cla(handles.axes3)
cla(handles.axes5)
cla(handles.axes4)
axes(handles.axes2);
x=.01;y=.01;
Name = 'Enroll no = 12002060501027'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes3);
x=.01;y=.01;
Name = 'Name = Skandha Trivedi'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes4);
x=.01;y=.01;
Name = 'Father name:---'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes5);
x=.01;y=.01;
Name = 'Electronics and Communication'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes6);
x=.01;y=.01;
Name = 'semester-6th,year-3rd'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes7);
x=.01;y=.01;
Name = 'Counselor=Kavindra jain, Department Head=Hitesh shah'
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
axes(handles.axes9);
AA2=imread(['C:\Users\HP\Downloads\WhatsApp Image 2023-03-10 at 1.21.32 PM.jpeg'])
imshow(AA2);
%
end
guidata(h0bject,handles);
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.
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
input =str2num(get(hObject,'string'));
guidata(hObject,handles);
% 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
ERROR -------
Error using text
Unrecognized property Fontmane for class Text.
Error in ATS>pushbutton1_Callback (line 101)
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in ATS (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)ATS('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.

Antworten (1)

Walter Roberson
Walter Roberson am 11 Mär. 2023
TH = text(x,y,Name,'color','b','Fontsize',16,'Fontmane','Times');
Notice that you coded Fontmane instead of Fontname

Kategorien

Mehr zu Debugging and Analysis finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by