필터 지우기
필터 지우기

How can I make a vector divide 1 by increasing numbers?

조회 수: 2 (최근 30일)
Seba.V
Seba.V 2019년 7월 21일
댓글: Seba.V 2019년 7월 21일
how can I generate a vector with values 1,1/2,1/3...1/10?

채택된 답변

Guillaume
Guillaume 2019년 7월 21일
v = 1 ./ (1:10)
  댓글 수: 6
Guillaume
Guillaume 2019년 7월 21일
No, that only gives me a value of 10.
You could at the very least try the answers you are given, otherwise we're not going to go very far...
Seba.V
Seba.V 2019년 7월 21일
Sorry, I was mistaking with spaces between characters..:/ all answers work. Thank you everyone!!

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2019년 7월 21일
i = 1;
while i <= 10
v(i) = 1./i;
i = i + 1;
end

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by