n=input('n: '); %n=80
uy=0.2;
while n<120
n=n+10;
uy=uy+0.1;
if uy>=0.4&uy<=0.6
n
uy
continue
end
end
result
n=100&uy=0.4
n=110&uy=0.5
n=120&uy=0.6
I want the result converted into a matrix I'm making a gui I want it automatically thanks for helping me

 채택된 답변

Stephen23
Stephen23 2018년 9월 2일

1 개 추천

For various reasons, using a loop is not a good approach. Using colon or linspace will be numeric more stable, and more efficient:
>> n = 100:10:120
n =
100 110 120
>> uy = 0.4:0.1:0.6
uy =
0.40000 0.50000 0.60000

댓글 수: 1

Le Huu Dan
Le Huu Dan 2018년 9월 2일
Thanks. I'm making a gui I want it automatically

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

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2018년 9월 2일

편집:

2018년 9월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by