creating array with entries as numbers

i want to create an array indexing i=1:10
such that n{i}=1.44:1.45
so it must display n1=1.44
n2=1.441
.
.
n10=1.45
n=[n1 n2 n3 n4.....n10]
please help with this

댓글 수: 1

Stephen23
Stephen23 2020년 2월 24일
Use linspace (it will be more robust than using colon).

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

답변 (1개)

Alex Mcaulley
Alex Mcaulley 2020년 2월 24일

0 개 추천

Do you mean this?
n = 1.44:0.001:1.45;

댓글 수: 2

not exactly.i want if i set i=1:p
then n should also automatically take p elements with equal interval.
Then, as Stephen said use linspace:
n = linspace(1.44,1.45,10)

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

카테고리

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

태그

질문:

2020년 2월 24일

댓글:

2020년 2월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by