How to gracefully generate an all-one cell array?
Ältere Kommentare anzeigen
An all-one array can be gracefully generated by ones(...)
But what if I want an all-one cell array?
function Output=OnesInCell(varargin)
%This function should be the same as ones() except that each of the ones is packed into an individual cell.
end
For-loops are not graceful!
2 Kommentare
Alex Mcaulley
am 29 Okt. 2019
Rik
am 29 Okt. 2019
@Alex, it looks to me like this is the desired result, so I would suggest moving your comment to the answer section.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!