フィルターのクリア

How to insert Matrix?!

16 ビュー (過去 30 日間)
Manu Manu
Manu Manu 2014 年 3 月 16 日
回答済み: joginder pal singh 2021 年 1 月 6 日
Hello guys! I need to write a function and insert in the command window(not edit window) the matrixes. How should I write in function?
L=input('Please insert matrix L')
This should work? And then I have to concatenate two matrix. Please help!? And If this works.. how should I insert? like this: [0 5 .. etc ? ] Thank you!
  1 件のコメント
Manu Manu
Manu Manu 2014 年 3 月 16 日
Oh, I get it. But can you help me with this: I need to write a program who recieves as arguments the matrix(same order): L,U,Q and R,Q are invertible matrix. The program returns the resultated matrix by vertically concatenation of 2 matrixes. The first one it's built by concatenation-horizontally of the matrix L,U,Q and R, and the second one by concatenation-horizontally of matrix L * U , U + R , L(transpose)and Q(at -1) +R . The program returns vid matrix if the conditions are not respected.
Thank you so much.. some hints, please.

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

採用された回答

Paul
Paul 2014 年 3 月 16 日
編集済み: Paul 2014 年 3 月 16 日
Yes you can do that, why don't you just do test it? You can add \n to put the input on a new line.
L=input('Please insert matrix L\n')
And then you type for example [0 1; 2 3] For concatenation of matrices you can do:
M = [A, L] % horizontal concatenation, A and L should have same # of rows
or
M = [A; L] % vertical concatenation, A and L should have same # of columns
  1 件のコメント
Manu Manu
Manu Manu 2014 年 3 月 16 日
And how about the last condition? I don't get.. what should be respected? what Condition? Thank you so much!

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

その他の回答 (2 件)

Manu Manu
Manu Manu 2014 年 3 月 16 日
It worked man! Thank you!

joginder pal singh
joginder pal singh 2021 年 1 月 6 日
L=input('Please insert matrix L\n')

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by