how to save the values of DelL(T)

조회 수: 2 (최근 30일)
Viswajit Talluru
Viswajit Talluru 2022년 10월 25일
댓글: VBBV 2022년 10월 25일
Lo = 44.46
Do = 18.76
alpha = 0.0002178
for T = 36:1:180
DeltaL = Lo*alpha*(T-35)
DelL(T) = DeltaL
end
I need the T value going from 36 through 180 and store the values in array

답변 (2개)

Chunru
Chunru 2022년 10월 25일
Lo = 44.46;
Do = 18.76;
alpha = 0.0002178 ;
T = 36:1:180;
DelL = Lo*alpha*(T-35);
whos
Name Size Bytes Class Attributes DelL 1x145 1160 double Do 1x1 8 double Lo 1x1 8 double T 1x145 1160 double alpha 1x1 8 double cmdout 1x33 66 char

VBBV
VBBV 2022년 10월 25일
Lo = 44.46
Lo = 44.4600
Do = 18.76
Do = 18.7600
alpha = 0.0002178
alpha = 2.1780e-04
for T = 36:1:180
DeltaL = Lo*alpha*(T-35);
DelL(T) = DeltaL;
end
DelL(DelL == 0) = [] % use this to delete zeros in DelL matrix
DelL = 1×145
0.0097 0.0194 0.0291 0.0387 0.0484 0.0581 0.0678 0.0775 0.0872 0.0968 0.1065 0.1162 0.1259 0.1356 0.1453 0.1549 0.1646 0.1743 0.1840 0.1937 0.2034 0.2130 0.2227 0.2324 0.2421 0.2518 0.2615 0.2711 0.2808 0.2905
  댓글 수: 2
VBBV
VBBV 2022년 10월 25일
Matlab creates vector of zeros preceding the array formed using for loop. In your case, it is DelL array
VBBV
VBBV 2022년 10월 25일
Alternately, you can do it much simpler way without for loop as suggested by @Chunru.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by