not providing a fixed input
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
NAVNEET NAYAN
il 24 Lug 2018
Modificato: KALYAN ACHARJYA
il 24 Lug 2018
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.
0 Commenti
Risposta accettata
KALYAN ACHARJYA
il 24 Lug 2018
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!