Solving equations in a for loop with changing variables
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Juan Sagarduy
il 30 Ott 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 Commenti
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!