フィルターのクリア

How to create a MATRIX nx2

12 ビュー (過去 30 日間)
Francesca Accetta
Francesca Accetta 2018 年 2 月 18 日
回答済み: Niwin Anto 2018 年 2 月 21 日
Hi. I have a question. I need to create a MATRIX of this type (nx2): A=[1 1; 1 2; 1 3;1 4]
Where the second column represents the time, and will change, changing the problem. I would like to split this matrix so that creating a row vector for the time, in this way changing the vector, the matrix A will change automatically. It is possible? Thank you

回答 (1 件)

Niwin Anto
Niwin Anto 2018 年 2 月 21 日
MATLAB numeric variables(including matrices, arrays, etc. of the built-in data types) are value objects. when you copy a to the variable b, both variables are independent of each other. Changing the value of a does not change the value of b.
So It is not possible to change matrix A automatically.You have to change A matrix whenever a change in row vector for time.
A = [A(:,1),b'] %b is the row vector for time

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by