Resizing a Matrix in MATLAB?
30 次查看(过去 30 天)
显示 更早的评论
Hi,
Q.1: I have a matrix A of size 106 1 100. and after A = squeeze(A), the size is 106 100. Suppose I want unsqueeze A again to get back its size 106 1 100. How can I unsqeeze it?
Q.2: I have a matrix B of size 100 97 and I want resize it as 100 106 by adding 9 columns in the start (each has constant number). how I can do it in MATLAB?
0 个评论
采纳的回答
Torsten
2022-11-17
%Q1
A = rand(106,1,100);
size(A)
A = squeeze(A);
size(A)
A = reshape(A,[106 1 100]);
size(A)
%Q2
A = rand(100,97);
start_A = rand(100,9);
A = [start_A,A];
size(A)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!