how to save the values of DelL(T)

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

Respuestas (2)

Chunru
Chunru el 25 de Oct. de 2022
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 el 25 de Oct. de 2022
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 comentarios

VBBV
VBBV el 25 de Oct. de 2022
Matlab creates vector of zeros preceding the array formed using for loop. In your case, it is DelL array
VBBV
VBBV el 25 de Oct. de 2022
Alternately, you can do it much simpler way without for loop as suggested by @Chunru.

Iniciar sesión para comentar.

Categorías

Productos

Preguntada:

el 25 de Oct. de 2022

Comentada:

el 25 de Oct. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by