Borrar filtros
Borrar filtros

Plot with loop separately all figures

1 visualización (últimos 30 días)
Ferial Assmani
Ferial Assmani el 1 de Abr. de 2016
Comentada: John BG el 2 de Abr. de 2016
For reason of clarity, i want to plot separately all figures, thy mast be (Nbr_Position * Nbr_Case) plot, i have tried this but it does not work:
clear all; clc; close all;
V_Time = [1, 2, 3]; % Time Vector fixe length
%
V_Data = 1:1:12; % Data Vector
Nbr_Position = 2; % Nbr of position
Nbr_Case = 2; % Nbr of cases
%
N_Rows= length(V_Time); % Nbr of rows for matrix
N_columns= length(V_Data)/N_Rows; % Nbr of columns for matrix
M_Brut= (reshape(V_Data,[N_Rows,N_columns])) % Brut matrix from Data Vector
%
%
for i=1:N_columns % loop by position
figure
for j=1:Nbr_Case % loop by case
plot(V_Time',M_Brut(:,i)) % plot Time Vs M_Brut (Data i line)
end
title(['Position N°: ' num2str(i) ' &' ' Case ' num2str(j)]) % title
legend(['Case' num2str(j)]) % legend
end
  2 comentarios
Chad Greene
Chad Greene el 1 de Abr. de 2016
This seems to work for me. It creates four figures. What do you mean by "it doesn't work"?
John BG
John BG el 2 de Abr. de 2016
tried in R2012 R2015a and R2016a and it works for me

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by