フィルターのクリア

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 Center および File ExchangeMatrices and Arrays についてさらに検索

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by