How to do what MATLAB does with array[index:index] in Maxima?
1 次查看(过去 30 天)
显示 更早的评论
I can't figure out how to dynamically take a portion at a time of a column vector in Maxima; for example I have the vector v = [a, b, c, d, e] and I want to take this: [a], [a, b], [a, b, c], etc. How can you do this in Maxima?
0 个评论
回答(1 个)
KSSV
2021-12-28
v = [1 2 3 4 5] ;
N = length(v) ;
iwant = cell(N,1) ;
for i = 1:N
iwant{i} = v(1:i) ;
end
celldisp(iwant)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!