0
$\begingroup$

If I have a matrix

1, 1, 2, 2 1, 2, 2, 3 2, 2, 3, 3 2, 3, 3, 3 

What operation do I need to perform to create a "scaled" version:

1, 1, 1, 1, 2, 2, 2, 2 1, 1, 1, 2, 2, 2, 2, 2 1, 1, 1, 2, 2, 2, 2, 3 1, 1, 2, 2, 2, 2, 3, 3 1, 2, 2, 2, 2, 3, 3, 3 2, 2, 2, 2, 3, 3, 3, 3 2, 2, 2, 3, 3, 3, 3, 3 2, 2, 3, 3, 3, 3, 3, 3 2, 3, 3, 3, 3, 3, 3, 3 

I thought it was a Product. Or is there a vector operation?

  • 0
    Your question is somewhat ill-posed. What kind of "operations" do you have in mind? If you mean something like matrix multiplication, I don't think this will work, because the [rank](http://en.wikipedia.org/wiki/Rank_(linear_algebra)) of the result can be at most the rank of your original matrix (and the rank of a scaled version would probably be higher).2012-04-19
  • 0
    @m_l, I was worried about that with my question. I finished Linear Alegbra too many years ago. Perhaps I need to work with an Array of Vectors2012-04-19
  • 0
    There is a product that, in a way, "tiles" a bigger matrix with multiples of a smaller one (see [here](http://en.wikipedia.org/wiki/Kronecker_product)). But that is not what you are looking for. Do you need this scaling in a mathematical context or for programming? If the latter is the case, I would just define the resulting matrix entrywise.2012-04-19
  • 0
    @m_l, programming for a simple tile set. I want to keep the pattern, but along it to scale to a larger area.2012-04-19
  • 0
    As I do not see an elegant solution, I'd try the naive approach: Let the original matrix be an $m\times n$ matrix $A$ and the result an $s \times t$ matrix $B$. Define $B_{i,j} := A_{\text{round}(im/s),\text{round}(jn/t)}$.2012-04-19
  • 0
    @m_l, very interesting, I'll try that out. I may then be able to normalize it to my needs as well.2012-04-19
  • 0
    @m_l, that's exactly it! Put that down as an answer and I'll mark it correct. Thank you.2012-04-19
  • 0
    This is basically image up-scaling (http://en.wikipedia.org/wiki/Image_scaling) with nearest neighbor interpolation.2012-04-19
  • 0
    Wow, that's a nice link. Those hq*n*x algorithms produce some impressing output. The power of anti-aliasing, I guess. :)2012-04-19

1 Answers 1

1

As mentioned in the comments, I don't see a "mathematical" or "elegant" way to solve this, particularly not by linear transformations (impossible because of rank).

But here is one way it works: Let the original matrix be an $m \times n$ matrix $A$ and the resulting matrix an $s \times t$ matrix $B$. Then define $B_{i,j} := A_{\text{round}(im/s),\text{round}(jn/t)}$.