Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Matrices with different numbers of equations

1 visualización (últimos 30 días)
Robert Pratt
Robert Pratt el 24 de Mzo. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I'm supposed to construct a system of equations (Ax=b) matrix that will change depending on the number of equations given. For the forces on a bridge structure, I have equations for the first 4 and the last 4 rows of 'A'. I know how to make a matrix with these but depending on the number of nodes (N) in the structure, the number of equations will change. I'm told 'A' will be a 2N x 2N matrix and 'x' will be a 2N x 1 vector and 'b' is a 2N x 1 vector of constants. I know the equations that are dependent on the number of nodes have to utilize a loop. How would I initialize the 'A' and 'b' matrix with the zeros function manually?

Respuestas (1)

John D'Errico
John D'Errico el 24 de Mzo. de 2020
You know the size of the matrix. You already know you need to use zeros to initialize it.
A = zeros(2*N,2*N);
b = zeros(2*N,1);
You might want to read the help, especially when you already know what you want to do.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by