How can I create a column matrix whose elements are unknown variables

조회 수: 11 (최근 30일)
Goldmine
Goldmine 2019년 10월 26일
답변: Ajay Pattassery 2019년 10월 29일
Hello. How can I create a matrix whose elements are unknown at the start of calculation but will eventually be occupied after solving? The matrix is a column vector of unknown variables [T1, T2, T3,... Tn], where Tn depends on my specified size of matrix, n. When I vary 'n' , it should be able to affect the size of my column vector [T1, T2, T3,... Tn] when I begin to run the simulation. Thank you for your help.

답변 (1개)

Ajay Pattassery
Ajay Pattassery 2019년 10월 29일
If you know n, then you could define a column vector as
vector = zeros(n,1);
Later you can assign the values for each position in the vector as and when you compute it.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by