フィルターのクリア

Create a row vector

401 ビュー (過去 30 日間)
Francis Adams Kwofie
Francis Adams Kwofie 2021 年 6 月 24 日
編集済み: DGM 約3時間 前
Create a row vector named x that starts at 1, ends at 10, and contains 5 elements.
  2 件のコメント
Balanarayanan
Balanarayanan 2023 年 1 月 23 日
Create a row vector named b that starts at 1, ends at 10, and contains 5 elements.
Image Analyst
Image Analyst 2023 年 1 月 23 日
@Balanarayanan This looks like a homework problem. If you have any questions ask your instructor or read the link below to get started:
Obviously we can't give you the full solution because you're not allowed to turn in our code as your own, but it will involve linspace and the ' (apostrophe) symbol.

サインインしてコメントする。

採用された回答

DGM
DGM 2021 年 6 月 24 日
編集済み: DGM 2021 年 6 月 24 日
one way:
x = 1:2.25:10
x = 1×5
1.0000 3.2500 5.5000 7.7500 10.0000
another way
x = linspace(1,10,5)
x = 1×5
1.0000 3.2500 5.5000 7.7500 10.0000
of course, nothing says the vector had to be linear:
x = logspace(0,1,5)
x = 1×5
1.0000 1.7783 3.1623 5.6234 10.0000
or monotonically increasing
x = [1 500 -pi sqrt(2) 10]
x = 1×5
1.0000 500.0000 -3.1416 1.4142 10.0000

その他の回答 (2 件)

Image Analyst
Image Analyst 2021 年 6 月 24 日
You learn these basics in the first half hour of the intro MATLAB course. Evidently you need to take this:
  2 件のコメント
Balanarayanan
Balanarayanan 2023 年 1 月 23 日
Transpose b from a row vector to a column vector using the transpose operator.
Image Analyst
Image Analyst 2023 年 1 月 23 日

サインインしてコメントする。


Meghana
Meghana 約3時間 前
Create a row vector that has the following elements: , , , , 129, and .
  1 件のコメント
DGM
DGM 約3時間 前
編集済み: DGM 約3時間 前
Oh that's easy
a = 129
a = 129
Note that a scalar is both a row vector and a column vector. It's also a matrix.
% yes, it's a row vector
[isscalar(a) isvector(a) isrow(a) iscolumn(a) ismatrix(a)]
ans = 1x5 logical array
1 1 1 1 1
You probably didn't want that, but you never bothered to actually check to see if what you copy-pasted actually worked.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by