How do I reduce the number of columns in matrix?
5 views (last 30 days)
Show older comments
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)
0 Comments
Accepted Answer
Voss
on 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
0 Comments
More Answers (0)
See Also
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!