Simple C++ Dynamicly allocated Matrix with only one memory allocation
Since you have the new keyword, you should make a destructor and delete[].

~Matrix()
{
    delete[] data;
    data = nullptr;
}

Note that it is not necessary to set data = nullptr in the destructor, because it will be deleted as soon as the destructor is called.

You are missing a copy constructor which can cause problems when assigning one matrix to another

What happens if the number passed in [] when slicing from the matrix is out of bounds?

Have a glance at std::initialzer_list in C++, it will simplify assigning values to the matrix.

You will have to overload the arithmetic operators ( +, -, *, /) if you want to perform any kind of operations between two matrices

Lastly, I was a little confused to see size_t rather than std::size_t, if you have using std::size_t in your source code, you should have it here too to avoid confusion.