Concat or merge a plot (matrix) into another plot(matrix) using for loop

조회 수: 1 (최근 30일)
liju Abraham
liju Abraham 2019년 3월 19일
편집: Stephen23 2019년 3월 19일
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개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by