how to code this
Informazioni
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
Mostra commenti meno recenti
x=input
y=input
with using if and for
-summation of numbers beetwen x and y
-average of numbers beetwen x and y
-finding how many numbers there are in beetwen x and y
-generate 5 random numbers beetwen x and y
with using if and while
-summation of numbers beetwen x and y
-average of numbers beetwen x and y
-finding how many numbers there are in beetwen x and y
can you help me with this quiz (matlab)
3 Commenti
KSSV
il 5 Mag 2020
For input read about input. For loops read about for. For mean read about mean.
Paresh yeole
il 5 Mag 2020
with using if and for
% Assumption that x and y are integers and y>x
%summation of numbers beetwen x and y
sum= 0
for i=x:1:y
sum = sum +i;
end
%average of numbers beetwen x and y
avg = sum/(y-x+1);
%finding how many numbers there are in beetwen x and y
numbers = y-x+1;
%generate 5 random numbers beetwen x and y
% Assuming the difference is greater than 5
randnum = ranperm(y-x) +x;
Similarly can be done for while
Sinan Sahiner
il 5 Mag 2020
Risposte (1)
Guru Kumaresan
il 13 Lug 2021
0 voti
Hi Sinan,
It seems you are new to MATLAB programming. To start with programming in MATLAB you can start with MATLAB Onramp course – MATLAB Onramp
After completing it, to get some more knowledge on MATLAB you can go for a course for MATLAB fundamentals - MATLAB fundamentals
Questa domanda è chiusa.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!