What is wrong in my coding?

1 visualización (últimos 30 días)
MR JUSTIN ACHARJEE Sumanta
MR JUSTIN ACHARJEE Sumanta el 20 de En. de 2022
Respondida: KSSV el 20 de En. de 2022
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

Respuestas (1)

KSSV
KSSV el 20 de En. de 2022
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

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by