So I need to create a matrix were first column of the matrix is 30 rows of the first column vector then second column of the matrix is also 30 rows of second column vector and same for the third column of the matrix which is also 30 rows of the third vector. Is there a very simple command for that beacuse i simply can't find. And also is it possible to export my matrix to excell on matlab online.

4 件のコメント

the cyclist
the cyclist 2020 年 4 月 12 日
編集済み: the cyclist 2020 年 4 月 12 日
I don't understand how 1 column can be 30 rows.
Can you give a very small example of your input and expected output? Maybe use an example where you just need 3 instead of 30, to keep in manageable in size? Ideally, write it out in valid MATLAB syntax, not just text, so we know exactly what you mean.
Image Analyst
Image Analyst 2020 年 4 月 12 日
Here is an example of a 1 column, 30 row array:
v = rand(30, 1);
Ivan Tulic
Ivan Tulic 2020 年 4 月 12 日
Sorry, maybe i wrote it wrong but i have 3 matrixes for example each is 30x1 and i need to use those three to create a fourth but fourth needs to be create in the way that in the first column i need to have 3 rows of the first matrix and so for second and the third row.
the cyclist
the cyclist 2020 年 4 月 12 日
@IA -- I certainly didn't state my confusion very clearly, did I? :-)
But this seems to have been resolved, so I won't bother trying again.

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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 12 日

0 投票

From your question, it appears that you want to concatenate the matrix. In MATLAB, square brackets [ ] are used for concatenation. See this example: https://www.mathworks.com/help/matlab/math/creating-and-concatenating-matrices.html#OverviewCreatingAndConcatenatingExample-3
v1 % 30x1 vector
v2 % 30x1 vector
v3 % 30x1 vector
V = [v1 v2 v3];

3 件のコメント

Image Analyst
Image Analyst 2020 年 4 月 12 日
If they're more than 30 rows, then you can do
V = [v1(1:30), v2(1:30), v3(1:30)]
to extract and horizontally concatenate the first 30 rows only.
Ameer Hamza
Ameer Hamza 2020 年 4 月 12 日
Thanks for adding the additional note.
Ivan Tulic
Ivan Tulic 2020 年 4 月 12 日
It worked thanks for the help

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

その他の回答 (1 件)

venkata ganesh nalajala
venkata ganesh nalajala 2021 年 2 月 1 日

0 投票

Create a variable x that contains the value in the 6th row and 3rd column of the variable data.

1 件のコメント

Jackson
Jackson 2023 年 10 月 16 日
x = data(6,3)

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

カテゴリ

製品

リリース

R2020a

タグ

質問済み:

2020 年 4 月 12 日

コメント済み:

2023 年 10 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by