Matrix Multiplication and addition

Hi all

How can I solve the give vectors ..
Mathmatically with the help of Java?
double[] weight = {5.0, 3.0, 0.0};
		double[] sample = {1, 2, 3};
		
		double inFu   = 1.00;
		double vLearn = 0.10;
		
		double[] newVector;
		newVector = (weight + inFu * vLearn * (sample - weight));

Open in new window

ZURINETAsked:
Who is Participating?
 
for_yanCommented:
I think there was an extra parenthesis before

double[] weight = {5.0, 3.0, 0.0};
double[] sample = {1, 2, 3};

double inFu   = 1.00;
double vLearn = 0.10;

double[] newVector = new double[3];

for (int j=0;j<3;j++)
newVector[j] = (weight[j] + inFu * vLearn * (sample[j] - weight[j]);
0
 
for_yanCommented:
double[] weight = {5.0, 3.0, 0.0};
double[] sample = {1, 2, 3};

double inFu   = 1.00;
double vLearn = 0.10;

double[] newVector = new double[3];

for (int j=0;j<3;j++)
newVector[j] = (weight[j] + inFu * vLearn * (sample[j] - weight[j]));
0
 
ZURINETAuthor Commented:
Hoi for Yan
Thanks a lot
0
 
for_yanCommented:
You are always welcome.
I hope you were not offended by my remark.
I really wanted to share my feelings and make all of our interactions more fruitful.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.