How do I reduce the number of columns in matrix?

5 Ansichten (letzte 30 Tage)
Tunde Adubi
Tunde Adubi am 6 Jul. 2022
Beantwortet: Voss am 6 Jul. 2022
Reduce the number of columns in a matrix variable (zh) and store in new variable (zhs) and retain class type.
zh = 600 X 416; double
becomes
zhs= 600 X 413; double
zhs(zh(600,416))=[];
figure('position',[50 100 1400 400]);
xtime= datenum(time(1:413,1));
x_t= datetime(xtime, 'ConvertFrom','datenum','Format','dd-MMM-uuuu HH:mm:ss');
pcolor(x_t,rng,zhs)

Akzeptierte Antwort

Voss
Voss am 6 Jul. 2022
% zh = 600 X 416; double
columns_to_remove = [80 109 237]; % specify which columns will be removed from zhs
zhs = zh;
zhs(:,columns_to_remove) = []; % remove the columns
% zhs= 600 X 413; double

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by