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일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2018년 7월 24일

편집:

2018년 7월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by