How to make a matrix using a column sweep?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am a new user in Matlab. I derived a set of following equations:
A(i,j)*alpha/dt - A(i,j+1)*gamma/dt - A(i,j-1)*delta/dt = A(i-1,j)*beta/dt
I declared a rectangular matrix of A with initial zero values for all the row and columns. Declared all the coefficients and now i want to set all the values for all nodes in the matrix except the boundary rows and columns i.e. 1st and last column and row. My code is not working. Could anyone help me in setting up the matrix.
%for the inner nodes
for i = 2:(N-1)
for j = 2:(M-1)
A(i,j) = alpha/dt
A(i-1,j) = beta/dt
A(i,j+1) = gamma/dt
A(i,j-1) = delta/dt
end
end
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Assembly in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!