Concat or merge a plot (matrix) into another plot(matrix) using for loop
1 view (last 30 days)
Show older comments
I need to creat a final plot/matrix C where a 'special load' is concated multiple times into a 'general load', in this case the special loads start at 30 and have an interval of 10. With some help the for loop was created where Mark(1) is the position in general load and Mark(2) is the position of where my special load is added.
A=xlsread('general_load.xlsx');
B=xlsread('test_gust_special_load');
a_length = A(end,1);
b_length = B(end,1);
N = 30:15:a_length;
mark(1) = 0;
mark(2) = 0;
C = [];
for i = 1:length(N)
A_seg = A( A(:,1) > mark(1) & A(:,1) <= N(i) , :);
mark(1) = A_seg(end,1);
A_seg(:,1) = A_seg(:,1) + mark(2);
B_seg = B;
B_seg(:,1) = B_seg(:,1) + A_seg(end,1);
C = [C;A_seg;B_seg];
mark(2) = B(end,1)*i;
end
subplot(2,2,[1,2])
plot (A(:,1),A(:,2));
subplot(2,2,[3,4])
plot (C(:,1),C(:,2));
Now the problem is that the special loads are not equidistant and I cannot figure it out.
0 Comments
Answers (0)
See Also
Categories
Find more on Legend in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!