how can i convert this
n=5;fact = 1 ;
for i = 1:n
fact =fact * i;
end;
disp(fact)
into while loop
with my best regards

 採用された回答

KSSV
KSSV 2020 年 4 月 7 日
編集済み: darova 2020 年 4 月 7 日

0 投票

i = 1 ;
f = 1 ;
n = 3 ;
while i<=n
f=f*i;
i = i+1 ;
end

6 件のコメント

Mohammed Bokhow
Mohammed Bokhow 2020 年 4 月 7 日
Sir KSSV You didn't answer me correctly
Mohammed Bokhow
Mohammed Bokhow 2020 年 4 月 7 日
did you read my qusetion carefully?
Mohammed Bokhow
Mohammed Bokhow 2020 年 4 月 7 日
how can i convert this
n=5;fact = 1 ;
for i = 1:n
fact =fact * i;
end;
disp(fact)
into while loop
with my best regards
Mohammed Bokhow
Mohammed Bokhow 2020 年 4 月 7 日
this was my question
KSSV
KSSV 2020 年 4 月 7 日
I gave you the answer.......you need to change the variables accoridng to yours thats it...
Mohammed Bokhow
Mohammed Bokhow 2020 年 4 月 7 日
ok how can i change them i'm bignner at using matlab

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Introduction to Installation and Licensing についてさらに検索

質問済み:

2020 年 4 月 7 日

編集済み:

2020 年 4 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by