calling random variables and using them in a loop
1 次查看(过去 30 天)
显示 更早的评论
This function will generate a normal distribution conditional by bounds:
i have used above code 3times and made 3 random variables like c,fi,gamma.now i want to calculate a linear equation like this q= (a*c)+(b*fi)+(k*gamma )....this is my problem :for solving that linear eQu. i need to produce 3 different random variables by above code and use them in a new code to get answer.also q will be a random number because of the nature of those random variables.please let me now if i want to produce 1e4 random number and have 1e4 output of q ,what should i do?
0 个评论
回答(1 个)
Razvan
2011-6-23
I don't understand your question very well... Do you have a system of 10^4 equations and you want to fit the 3 parameters: a, b, and c?
In this case just write your system of equations in matrix form: Q = Coef * X and solve for X: X = Coef \ Q. Here Q is a column vector of the q values, Coef is the matrix with 10^4 rows and on each row it contains the coefficients c, fi and gamma and the result X will give you a column vector with the best fit: a, b, and c
Best, Razvan
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!