How to use symsum to calcolate residuals
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
laura bagnale
am 25 Aug. 2021
Beantwortet: Walter Roberson
am 26 Aug. 2021
Hello everyone!
Could someone help me, please?
I have these vectors:
x = [0; 0; 0; 0; 1]
y = [1; 0.15; 0.03; 0; 0.89]
z=[0; 0.35; 0.70; 1; 0.86]
I would like to calculate this redisuals' expression:
Rtot = sumRi , Ri = (zi - a*xi - b*yi - c*xi*yi - d).^2
for each index i. For example for i = 4 I would have:
Ri = (0.86 - a*1 - b*0.89 - c*1*0.89 - d).^2.
Is there a way to perform this sum?
Thank you very much in advance for your suggestions and help.
Regards
Laura
5 Kommentare
Akzeptierte Antwort
Walter Roberson
am 26 Aug. 2021
Bringing down from above,
R = (z - a*x - b*y - c*x.*y - d).^2;
Rtot = sum(R);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!