Hi
I have this starting matrix that shows different layers into the soil.
A_example_1 = [0 -0.1; -0.1 -4.7; -4.7 -5];
I need a code that decides where to add my vector into my matrix. Ive defined that:
% Add layer in given depth for both example 1 and 2. In this code the example 1 i chosen.
vector_add = A_example_1(end,2)+1.15;
Now if the matrix is as A is right now, the program should add a layer so it gives this matrix:
ans_example_1 = [0 -0.1; -0.1 -3.85; -3.85 -4.7; -4.7 -5];
However… If the A matrix starts by having these layers:
A_example_2 = [0 -0.1; -0.1 -3; -3 -5];
Then the code should create a matrix that looks like this:
ans_example_2 = [0 -0.1; -0.1 -3; -3 -3.85; -3.85 -5]
Best Answer