MATLAB for Engineers - Introduction to while Loops (Part 2 of 4): Updating Variables and Counters
ฝัง
- เผยแพร่เมื่อ 21 ก.ย. 2024
- In this video, I introduce you to updating the value of a scalar variable and using a counter variable inside of a while loop. To explain this concept, we will take a look at an example problem where we determine how long it will take to double an initial account balance based on a specified annual rate of return. First, we'll take a look at the problem statement. Then, I'll walk you through a flow chart of the problem to visualize the use of a counter variable. Finally, we'll solve the problem in MATLAB.
A while loop is a loop structure for repeating a calculation until a specified condition is met. While loops are present in most programming languages and environments.
This is Part 2 of a 4 Part Series on while Loops.
Part 1 introduces the basic structure of a while loop and demonstrates a loop pass. Link to Part 1: • MATLAB for Engineers -...
Part 3 introduces the concept of storing the value of a loop variable inside of an array using an index variable. Link to Part 3: • MATLAB for Engineers -...
Part 4 introduces the concept of combing loops and logic by nesting an if statement inside of a while loop. Link to Part 4: • MATLAB for Engineers -...
The background music in the intro and outro was written and produced by Michael J Calamas for the exclusive use of David Calamas.
Understood this concept in 2 min compared to how my professor teaches. Thank you
Love the flowchart and code visual highlighting the process! Very cool!
hello, I'm from Indonesia. and your channel is really helpful for finding a detailed explanation of Matlab. your explanation is also easy to understand, I hope you can upload again some videos related to Matlab. thank you, professor,
Your videos are fantastic and easy to understand. I am watching it a day before my exam 😂❤
Outstanding explanation. Very easy to understand. Thanks a lot
Great explanation, Thank you so much.
Glad it was helpful!
Thanks for your comprehensive style of delivering lectures. Even the dumbest student can understand your lectures. I am a PhD student at ITB Bandung Indonesia and am trying to implement my algorithm using recursive least squares. Could you please make a video on this subject with practical example. Most videos I have seen doesn't give comprehensive explanation and examples.
many thankss wonderfull explanation!!
Thank you very much, you saved me😩💝💝
this is so helpful thank you very much
Im learning!!!
ur so clutch
Thank you :)
Great Explanation Professor , Lets buy some beers :)
hey, amazing videos! I have a somewhat unrelated question. say I wanted the balance to display as 20122 dollars rather than in scientific notation. how would I do that? Also, I have some output in the format "0.37154A(5.438715e-01" what does that represent?
The quickest way to display the output as a currency would be to use the format bank command. Otherwise, you could use the fprintf function.
thankss
I know it is a silly question but why have you add 1 in the statements??
So that at the end the value of year will tell you how much years have passed to reach that condition
Tau beta pi!
Good explanation just stop being such a robot 😭