How do I solve this matrix in a loop for different values for P?
Afficher commentaires plus anciens
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 commentaires
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
le 24 Fév 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
le 24 Fév 2022
ABHISHEK JHA
le 24 Fév 2022
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Multidimensional Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!