필터 지우기
필터 지우기

Plot with loop separately all figures

조회 수: 1 (최근 30일)
Ferial Assmani
Ferial Assmani 2016년 4월 1일
댓글: John BG 2016년 4월 2일
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
Chad Greene
Chad Greene 2016년 4월 1일
This seems to work for me. It creates four figures. What do you mean by "it doesn't work"?
John BG
John BG 2016년 4월 2일
tried in R2012 R2015a and R2016a and it works for me

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by