フィルターのクリア

array exceeds maximum array size preference.

2 ビュー (過去 30 日間)
mohamed elkasemy
mohamed elkasemy 2019 年 10 月 4 日
回答済み: Walter Roberson 2019 年 10 月 4 日
clc;
clear all;
close all;
t = [0:10^20];
K = 1.38*10^-23;
Me = 9.11*10^-31;
T = 1.3543*10^3;
V = 100*sqrt(3*K*T*11600/Me);
Ne = 1.42*10^24;
Np = 1.42*10^24;
E = 10^6;
b = (7.56*10^-16)*(6.24*10^18)*((11600)^4)/((100)^3);
F = ((1.166*10^-23)^2);
Y = sqrt(T^2-((Ne*Np*E*V*F*((1.239*10^-4)^2)*t)/(2*b)));
plot(t, Y)

回答 (2 件)

the cyclist
the cyclist 2019 年 10 月 4 日
編集済み: the cyclist 2019 年 10 月 4 日
In this line of code
t = [0:10^20];
You are trying to create a vector that is length 10^20.
That is ... uh ... big. If I did my quick math right, that's over a billion terabytes to store.

Walter Roberson
Walter Roberson 2019 年 10 月 4 日
0:10^20 requests an array counting 0, 1, 2, 3, all the way to 10^20. That would take about 2^69 bytes to represent. However, no x64 architecture can access more than 2^64 bytes in theory, and no publically released x64 chip can access more than 2^48 bytes -- there are no address lines A48 to A63.
If you did manage to hack an x64 system to have 2^69 bytes of memory, then it would take rather a while to create the array. If you used a multi core system that could initialize 10^10 per second then it would take about 316 years.

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by