Assigning Null / Multi-Dimensional Matrix
Show older comments
Hello,
I have a matrix with the dimensions of 4x2500 and I am generating this matrix in for loop. I want this matrix to be 4x1250. Without multi dimension I just write A(1:length(X)) = [] but I am stuck in multi dimension. This logic does not work in my operation.
when I say
A = [1:1:2500];
A (1:1250) = [];
it works and that is what i want to do.
but in multi dimension,
for i = 1:1:4
A(i,:) = ????????
end
Can someone help me? Thanks.
2 Comments
KSSV
on 7 Apr 2022
Question is not clear. What you want to do in the loop?
tinkyminky93
on 7 Apr 2022
Accepted Answer
More Answers (1)
A = repmat(1:5,4,1)
A(:,1:3) = []
1 Comment
tinkyminky93
on 7 Apr 2022
Edited: tinkyminky93
on 7 Apr 2022
Categories
Find more on Creating and Concatenating Matrices 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!