Generate new samples from available data
Mostra commenti meno recenti
Hi I have three variables (a,b,c) as input and their output is a variable d. I have generated 30 samples by varying inputs and getting output. Now i want to generate new samples using the data of available samples. Please guide me how to do this in Matlab. These are not random data samples.
Risposta accettata
Più risposte (1)
Image Analyst
il 20 Gen 2022
How about just getting a random number from each of your input ranges. Like:
a = [100 200 300];
b = [11 12 13];
c = [600 900 1200];
numPointsNeeded = 4 % Or 1 or 30 or however many you need.
aNew = a(1) + (a(3) - a(1)) * rand(1, numPointsNeeded)
bNew = b(1) + (b(3) - b(1)) * rand(1, numPointsNeeded)
cNew = c(1) + (c(3) - c(1)) * rand(1, numPointsNeeded)
4 Commenti
Haris Hameed
il 20 Gen 2022
Image Analyst
il 20 Gen 2022
I didn't say d was a random number. All I said was to generate some new a,b, and c and then use those to computer your new d using your non-random formula or function.
Sure, the a, b, and c were randomly picked from the range you gave, but only they are random, not the d that is computed from them.
If you need a more systematic way of generating new a,b,c values, then tell us what it is. Like maybe you want every value with the middle value being the step size. You can do that with a nested for loop:
a = [100, 200, 300];
b = [11, 12, 13];
c = [600, 900, 1200];
for ka = a(1) : a(2) : a(3)
for kb = b(1) : b(2) : b(3)
for kc = c(1) : c(2) : c(3)
d = MyFunctionForD(ka, kb, kc);
end
end
end
Haris Hameed
il 20 Gen 2022
Image Analyst
il 20 Gen 2022
Not sure how the existing 28 d values will enable you to get more values for d.
if d1 = function(a, b, c) and you want a new set d2. I don't see how you can get new d2 only from d1 (the "calculated 28 points"), while not using new a,b,c values, unless you just create a distribution of d1 and try to get random values from it. Like a statistical estimation/prediction.
I think the best way would be to get some more values for a, b, and c and compute your new d values. So you can either get random a, b, c values, OR you can do it in some systematic way (like doing all values of a, b, and c). I showed you both ways.
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!