Hi, friend! I have thought of a search method that saves much time.
Firstly, the problem can be converted to V = 1:1:M, there exist 'w', 'x', 'y', and 'z', where w,x,y,z belongs to V. Calculate all w<x<y<z such that w+x+y+z = M. because you can just let M=10*M, and x,y,z,w are all positive integers, you need only use [x,y,z,w] = 0.1*[x,y,z,w], as also mentioned by @the cyclist. Here I provide integer solution. I believe you can understand me. The code speaks! So look at following code I wrote for this problem.
The search function is
function Result = searchPartition(M)
R(count,:) = [alpha, beta, gamma, delta];
To validate its correctness, here I perform a test
Result = searchPartition(20)
Then get the result as
23 results were obtained, the columns from left to right are w,x,y,z accordingly.
Also, to verify its efficiency, here we choose M ranged from 200 to 1000 with interval 200, and calculate the cost time!
Time_array = zeros(size(M_array));
ResultSize_array = zeros(size(M_array));
for i = 1:1:numel(M_array)
Result = searchPartition(M);
ResultSize_array(i) = size(Result,1);
plot(M_array, Time_array,'r', 'linewidth',2)
title('Cost Time V.S. M')
plot(M_array, ResultSize_array,'b', 'linewidth',2)
title('Result size V.S. M')
loglog(ResultSize_array,Time_array, 'ro-', 'linewidth',2)
title('Time cost V.S. Result size Loglog Plot')
It is found that when M = 1000, the time spent in my method is less than 2 seconds, while the result size reaches 7000,000, which is a quite large number! I hope you like it ovo