Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
AS
AS el 10 de Ag. de 2020
Comentada: AS el 10 de Ag. de 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.

Respuesta aceptada

KSSV
KSSV el 10 de Ag. de 2020
for i = 1:1801
for j = 70:75
  7 comentarios
KSSV
KSSV el 10 de Ag. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by