AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Matlab diagonal matrix from vector3/21/2024 Leave it in a package for a while, and let things shake out. Given all this, my answer to question is put it in stdlib.Īnd in answer to to yeah. This summer, I heard Jeff say "whatever the question, putting it in base is not the solution". I don't have the breadth of perspective that others in this thread do. For instance, Matrix(I, n, n) is actually very confusing to some casual (and not so casual) coders. The language is complicated enough that there is an argument for the core language and stdlib to have a set of composable pieces that is minimal, yet usable. A high-quality package that people will trust. (umm, or another verb, but that's another question) or 2) One could have a package that gives people the matlab (or python or whatever) -like things that they miss. For example, I have the vector: x 0 0 1 1 0 0, and would want a matrix of size 6x. Maybe the question is whether 1) with enough documentation, examples, culture change, etc., everyone finds copy(x) natural. I have a vector and I would like to have it repeated n-times forward and n-times backwards, but diagonally. Having just copy(diagonal(m)) or copy(eye(n)) (or Eye, or whatever) is obviously more orthogonal. It's too late now, but pre v1.0, I would have said that if eye goes, so does diag. I think (have no statistics) that many are upset with the disappearance of eye. Put the various v into a matrix and use eye () to. Then just repeat with a scrambled x and y - Im sure there is some function for that. v zeros (1, length (X)) for k 1 : length (X) row Y (k) col X (k) v (k) m (row, col) end. It also brings up again the question of how non-coders react to this. You can do this, where m is your matrix, and v is the vector of extracted values from the x,y locations. That is potentially disruptive and breaking though. I almost kind of think that diag should always return a view, then people can call copy if they need a copy.
0 Comments
Read More
Leave a Reply. |