Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是matlab的新手。我有一个数组50x100 uint8,我想把它改成5000x1 double. 我怎样才能做到这一点?提前致谢。
50x100 uint8
5000x1 double
如果您只想要一列数据,冒号运算符:也是一种选择:
:
data = uint8(randi(10,50,100)); result = double(data(:));
您可以使用reshape(matrix_to_resize, new_row_size, new_col_size)来调整数组的大小。您应该能够使用结果矩阵和im2double(matrix)函数将元素转换为双精度数。
reshape(matrix_to_resize, new_row_size, new_col_size)
im2double(matrix)
重塑的文档。