Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
AS
AS am 10 Aug. 2020
Kommentiert: AS am 10 Aug. 2020
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.

Akzeptierte Antwort

KSSV
KSSV am 10 Aug. 2020
for i = 1:1801
for j = 70:75
  7 Kommentare
KSSV
KSSV am 10 Aug. 2020
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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices 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