What is wrong in my coding?

조회 수: 1 (최근 30일)
MR JUSTIN ACHARJEE Sumanta
MR JUSTIN ACHARJEE Sumanta 2022년 1월 20일
답변: KSSV 2022년 1월 20일
Enter length of a statically determined beam and positions of the pinned support and the roller support. The process must be user-friendly, with step-by-step instructions and appropriate control of the entered data.
%%Q1a
clear;clc;
% Get the span of the beam along with positions of supports
l = input('Enter the span of the beam');%m
x =input('Enter the distance of pinned support from left end in m')
y = input('Enter the distance of roller support from left end in m')
% Check if the support locations specified are inside the span
while((x >l) || (y >l)
sprint('The support location should be inside the span')
x = input('Reenter the value of x')
y = input(' Reenter the value of y')
end
disp('OK')
% Check if the supports are not given at the same location
while((x == y))
sprintf('The supports cannot be at the same location')
x = input('Reenter the value of x')
y = input(' Reenter the value of y')
end
disp('OK')
% Check if the beam is overhanging or simply supported
if((x<l)&&(y<l))
sprintf('The beam is overhanging')
else('The beam is simply supported')
end

답변 (1개)

KSSV
KSSV 2022년 1월 20일
clc; clear all ;
%%Q1a
clear;clc;
% Get the span of the beam along with positions of supports
l = input('Enter the span of the beam');%m
x =input('Enter the distance of pinned support from left end in m') ;
y = input('Enter the distance of roller support from left end in m') ;
% Check if the support locations specified are inside the span
while((x >l) || (y >l))
sprintf('The support location should be inside the span')
x = input('Reenter the value of x') ;
y = input(' Reenter the value of y') ;
end
disp('OK')
% Check if the supports are not given at the same location
while((x == y))
sprintf('The supports cannot be at the same location')
x = input('Reenter the value of x') ;
y = input(' Reenter the value of y') ;
end
disp('OK')
% Check if the beam is overhanging or simply supported
if((x<l)&&(y<l))
sprintf('The beam is overhanging')
else
sprintf('The beam is simply supported')
end

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by