Filter löschen
Filter löschen

Plot with loop separately all figures

1 Ansicht (letzte 30 Tage)
Ferial Assmani
Ferial Assmani am 1 Apr. 2016
Kommentiert: John BG am 2 Apr. 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 Kommentare
Chad Greene
Chad Greene am 1 Apr. 2016
This seems to work for me. It creates four figures. What do you mean by "it doesn't work"?
John BG
John BG am 2 Apr. 2016
tried in R2012 R2015a and R2016a and it works for me

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by