Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

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

0
ZURINET
Asked:
ZURINET
  • 3
1 Solution
 
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
 
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
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now