필터 지우기
필터 지우기

How to populate a matrix automatically by column only?

조회 수: 10 (최근 30일)
cancel077
cancel077 2018년 10월 6일
편집: cancel077 2018년 10월 6일
Good day,
This may be a simple question, but I have been searching for this all over but yet to find the answer so here I go.
How do you populate a matrix automatically with intervals but columns only?
For instance, if I type:
A=[0.5:0.2:1.5]
This will generate:
A = 0.5 0.7 0.9 1.1 1.3 1.5
But I would like this matrix to be a single column and not a row?
Thank you in advance,

채택된 답변

Walter Roberson
Walter Roberson 2018년 10월 6일
You cannot do that directly. Instead, generate a row and transpose it.
A = (0.5:0.2:1.5) .';
  댓글 수: 1
cancel077
cancel077 2018년 10월 6일
편집: cancel077 2018년 10월 6일
Oh wow thanks that was super fast thank you!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by