How to define 1000*1000 matrix in matlab? Whenever I want to define a matrix 1000*1000, out of memory message was shown. Can anyone please help me?

15 次查看(过去 30 天)
%% How I am defining the matrix that I have given below
m=1000; n=1000;
A=zeros(m*n,m*n);
% whenever I want to run the problem OUT OF MEMORY message was shown in command window
  1 个评论
KSSV
KSSV 2020-8-2
编辑:KSSV 2020-8-2
Why you want to initialize such a huge dimension matrix? Your matrix dimension is going to be 10^6*10^6. Memory depends on your system RAM. Read about function memory to know further.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2020-8-2
Try this to get a 1000-by-1000 matrix
rows = 1000;
columns = 1000;
A = zeros(rows, columns);

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by