how to save the values of DelL(T)
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
Chunru
2022-10-25
Lo = 44.46;
Do = 18.76;
alpha = 0.0002178 ;
T = 36:1:180;
DelL = Lo*alpha*(T-35);
whos
0 个评论
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
DelL(DelL == 0) = [] % use this to delete zeros in DelL matrix
2 个评论
VBBV
2022-10-25
Matlab creates vector of zeros preceding the array formed using for loop. In your case, it is DelL array
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!