How can i create a long matrix?

1 view (last 30 days)
Fares Arafat
Fares Arafat on 21 Nov 2021
Answered: DGM on 21 Nov 2021
I am creating a Frame structure that will be solved using finite method element. I am currently discretizing my model into 40 elements. How can i input the node values in a faster way instead of manually listing the coordinates of each node. I have 3 beams in my frame. For the left beam i want to have 20 elements that increase by 1.5 in the y direction. For ex: nodeCoordinates=[0 0; 0 1.5; 0 3; 0 4.5; 0 6.......]

Answers (1)

DGM
DGM on 21 Nov 2021
Something like
N = 20;
A = [zeros(20,1) (0:1.5:(N-1)*1.5).']
A = 20×2
0 0 0 1.5000 0 3.0000 0 4.5000 0 6.0000 0 7.5000 0 9.0000 0 10.5000 0 12.0000 0 13.5000

Community Treasure Hunt

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

Start Hunting!