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

1 次查看(过去 30 天)
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