Solving equations in a for loop with changing variables
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all,
Not very experienced with matlab and trying to solve for d, L, and H as a function of x changing. The assignment asks that for the first half of x, H=0.5 and d=1.9 but I haven't been able to figure out how to start the loop in the middle of those vectors. I hardcoded a little bit to try to troubleshoot my first line, but the loop skews my depth somehow. Any advice would be greatly appreciated!
2 Kommentare
Antworten (1)
Juan Sagarduy
am 30 Okt. 2020
Hi Samantha The first line in your code in the loop is not correct. It should d(i)=d(i-1)-S.*x(i). But then the loop must start with i=2. Otherwise, MATLAB would throw an error. Good luck / Juan
0 Kommentare
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements 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!