how to specify the particular column numbers of a matrix in for loop

조회 수: 1 (최근 30일)
AS
AS 2020년 8월 10일
댓글: AS 2020년 8월 10일
I have a matrix withy dimension 1801 by 88. I want to select the column number 70:75 in for loop for analysis. If I start with
for i=1:1801
for j=1:5
It is only taking the first five columns. But I want get five columns having column number 70:75.
How can I do this.

채택된 답변

KSSV
KSSV 2020년 8월 10일
for i = 1:1801
for j = 70:75
  댓글 수: 7
KSSV
KSSV 2020년 8월 10일
clc; clear all ;
load ampli_512.dat;
load freq_512.dat;
load phase_512.dat;
pos = 70:75 ;
Am = zeros(1801,6) ;
Ph = zeros(1801,6) ;
Fq = zeros(1801,6) ;
for i=1:1801
for j=1:6
Am(i,j)=ampli_512(i,pos(j));
Ph(i,j)=phase_512(i,pos(j));
Fq(i,j)=freq_512(i,pos(j));
end
end

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by