How do I solve this matrix in a loop for different values for P?
Show older comments
x1= [-0.005:0.005]
x2= [-0.005:0.005]
x3= [-0.005:0.005]
x4= [-0.005:0.005]
x5= [-0.005:0.005]
w1= [-0.005:0.005]
w2= [-0.005:0.005]
w3= [-0.005:0.005]
w4= [-0.005:0.005]
w5= [-0.005:0.005]
P=[0 x1 w1
0 x2 w2
0 x3 w3
0 x4 w4
0 x5 w5]
A=[1.0000 0.005 0.02
1.0000 0.014 0.17
1.0000 0.022 0.42
1.0000 0.036 1.16
1.0000 0.052 2.44]
Y= A+P
B=[0.86
0.76
0.74
0.57
0.39]
aa=Y\B
4 Comments
What exactly is your question? Which different values for P would you want to have? Your code already runs.
x1= [-0.005:0.005];
x2= [-0.005:0.005];
x3= [-0.005:0.005];
x4= [-0.005:0.005];
x5= [-0.005:0.005];
w1= [-0.005:0.005];
w2= [-0.005:0.005];
w3= [-0.005:0.005];
w4= [-0.005:0.005];
w5= [-0.005:0.005];
P=[0 x1 w1
0 x2 w2
0 x3 w3
0 x4 w4
0 x5 w5];
A=[1.0000 0.005 0.02
1.0000 0.014 0.17
1.0000 0.022 0.42
1.0000 0.036 1.16
1.0000 0.052 2.44];
Y= A+P;
B=[0.86
0.76
0.74
0.57
0.39];
aa=Y\B
Jan
on 24 Feb 2022
The question is not clear. Simply run the same code with the different values of P.
Some hints:
[] is Matlab's operator for the concatenation of arrays. With [-0.005:0.005] you contcate the vector -0.005:0.005 with nothing, therefore the square brackets are a waste of time only.
ABHISHEK JHA
on 24 Feb 2022
ABHISHEK JHA
on 24 Feb 2022
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!