here is the picture of the cantilever beam for reference: Create the GUI \"Back-
ID: 3551944 • Letter: H
Question
here is the picture of the cantilever beam for reference:
Explanation / Answer
%here is the solution to main problem, i need you email id so that i can send you the gui file -----
function varargout = beam(varargin)
% BEAM MATLAB code for beam.fig
% BEAM, by itself, creates a new BEAM or raises the existing
% singleton*.
%
% H = BEAM returns the handle to a new BEAM or the handle to
% the existing singleton*.
%
% BEAM('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in BEAM.M with the given input arguments.
%
% BEAM('Property','Value',...) creates a new BEAM or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before beam_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to beam_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 beam
% Last Modified by GUIDE v2.5 10-Mar-2014 03:01:45
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @beam_OpeningFcn, ...
'gui_OutputFcn', @beam_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 beam is made visible.
function beam_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 beam (see VARARGIN)
% Choose default command line output for beam
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes beam wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = beam_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)
global W E I L a b dx;
x = inputdlg('enter the value of W: point load');
x=str2num(x{:});
W=x;
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global W E I L a b dx;
x = inputdlg('enter the value of E:Youngs Modulus');
x=str2num(x{:});
E=x;
disp(W);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global W E I L a b dx;
x = inputdlg('enter the value of I: moment of inertia');
x=str2num(x{:});
I=x;
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global W E I L a b dx;
x = inputdlg('enter the value of L: Length of beam');
x=str2num(x{:});
L=x;
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global W E I L a b dx;
x = inputdlg('enter the value of a: distance upto point of load');
x=str2num(x{:});
a=x;
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% global W E I L a b dx;
% x = inputdlg('enter the value of b: the distance of x');
% x=str2num(x{:});
% b=x;
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global W E I L a b dx;
x = inputdlg('enter the value of dx: step size');
x=str2num(x{:});
dx=x;
% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventadata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global W E I L a b dx;
beamStruct= struct('W',W,'E',E,'I',I,'L',L,'a',a,'b',b,'dx',dx)
displacement=0;
x=0;
i=2;
while(x<=L)
if((x<a)&&(x>=0))
displacement(i) = displacement(i-1)+(-W*x^2/(6*E*I))*(3*a-x);
else
displacement(i) = displacement(i-1)+ (-W*a^2/(6*E*I))*(3*x-a);
end
i=i+1;
x=x+dx;
end
theta = W*a^2/(2*E*I);
t=uitable;
set(t,'Data',displacement');
i=1:size(displacement,2)
plot(i,displacement);
msgbox(cat(2, 'theta is: ',num2str(theta)));
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.