Вопрос 1 РЕШЕНО
Я работаю над следующим моделированием:
x = [8 9 7 6 5];`
if isvector(x)
for i=1:length(x)
% simulation gives me a matrix y,t,z, (c by 5)
% where size(y,1)=size(z,1)=size(t,1)= lenght(x)=5
% size(y,2)=c
% a plot will collect all lines:
% for x=8 there are 3 lines ( the first row of each matrix `y`, `t`, `z`
% for x=9 there are 3 lines ( the second row of each matrix `y`, `t`, `z`
% ...
% for x=5 there are 3 lines ( the 5th row of each matrix `y`, `t`, `z`
end
end
Позвольте мне показать пример:
y = rand(5,8)
t = rand(5,8)
z = rand(5,8)
Для построения я начал с:
% I was using the initial loop:
if isvector(x)
for i=1:length(x)
% simulation gives me a matrix y,t,z, (c by 5)
%% plots
h(1)=figure;
plot (c,y(i,:));
grid on;
hold on;
plot (c,t(i,:));
plot (c,z(i,:));
hold off;
end
end
В результате MATLAB дает мне 3 цифры, но я ожидал только одну фигуру с несколькими строками. Я начинаю изнутри исходного l oop и создаю новый l oop, но это мне не помогает. Как это исправить? Как построить все линии (в этом примере все 15 строк (#x (i) = 5, #array = 3))?