필터 지우기
필터 지우기

calling random variables and using them in a loop

조회 수: 1 (최근 30일)
milad babaei
milad babaei 2011년 6월 22일
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?

답변 (1개)

Razvan
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

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by