필터 지우기
필터 지우기

not providing a fixed input

조회 수: 2 (최근 30일)
NAVNEET NAYAN
NAVNEET NAYAN 2018년 7월 24일
편집: KALYAN ACHARJYA 2018년 7월 24일
suppose I write a code:
function c=sum_of_two_numbers(a,b)
a=7;
b=8;
c=a+b;
end
here I have provided values of a and b. I want that whenever I run this code one should be asked to enter values of a and b and then getting C after entering a and b.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 24일
function c=sum_of_two_numbers(a,b)
a=input('Enter the 1st Number \n');
b=input('Enter the 2nd Number \n');
c=a+b;
fprintf('The result is %f',c);
end
  댓글 수: 2
NAVNEET NAYAN
NAVNEET NAYAN 2018년 7월 24일
Yes, this is working well. Thanks Kalyan..
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 24일
편집: KALYAN ACHARJYA 2018년 7월 24일
Welcome..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by