Hello all,
If I want to create a matrix of for example 9.5 with a specific size i.e. [9.5 9.5 .... 9.5], what should I do?

2 件のコメント

Ashok jat
Ashok jat 2019 年 5 月 18 日
x=ones(1,8);
y=9.5*x
Walter Roberson
Walter Roberson 2019 年 5 月 19 日
This is the same as Fangjun Jiang's solution.

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

 採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 9 月 5 日

1 投票

A=9.5*ones(3,4)

1 件のコメント

Bahareh
Bahareh 2011 年 9 月 5 日
thanks a lot.

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

その他の回答 (4 件)

bym
bym 2011 年 9 月 5 日

0 投票

m = 9.5*ones(1,15)

1 件のコメント

Bahareh
Bahareh 2011 年 9 月 5 日
thanks a lot.

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

Walter Roberson
Walter Roberson 2011 年 9 月 5 日

0 投票

A = repmat(9.5,3,4);
or
A(1:3,1:4) = 9.5;

1 件のコメント

Bahareh
Bahareh 2011 年 9 月 6 日
Thanks a lot Mr. Walter!

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

Bao Le
Bao Le 2019 年 12 月 5 日

0 投票

x = 9.5.*ones(2,5)

1 件のコメント

Walter Roberson
Walter Roberson 2019 年 12 月 5 日
This is the same as earlier solutions.

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

Alejandro Ayala
Alejandro Ayala 2019 年 12 月 5 日

0 投票

x = 9.5.*ones(2,5)

1 件のコメント

Walter Roberson
Walter Roberson 2019 年 12 月 5 日
This is the same as earlier solutions.

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

カテゴリ

ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索

製品

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by