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.

ความคิดเห็น • 22

  • @nathanturner5972
    @nathanturner5972 5 หลายเดือนก่อน +1

    Understood this concept in 2 min compared to how my professor teaches. Thank you

  • @EngineeringwithDrKelseyJoy
    @EngineeringwithDrKelseyJoy 2 ปีที่แล้ว +7

    Love the flowchart and code visual highlighting the process! Very cool!

  • @dwikyabdullah-qm4nc
    @dwikyabdullah-qm4nc 3 หลายเดือนก่อน

    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,

  • @humaismuhammad55
    @humaismuhammad55 3 ปีที่แล้ว +4

    Your videos are fantastic and easy to understand. I am watching it a day before my exam 😂❤

  • @geraldfokumla2877
    @geraldfokumla2877 2 ปีที่แล้ว +3

    Outstanding explanation. Very easy to understand. Thanks a lot

  • @sheikhaalfuqaei9161
    @sheikhaalfuqaei9161 3 ปีที่แล้ว +5

    Great explanation, Thank you so much.

  • @solomononuchefaruna5022
    @solomononuchefaruna5022 2 ปีที่แล้ว +1

    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.

  • @gizemkacann
    @gizemkacann 8 หลายเดือนก่อน

    many thankss wonderfull explanation!!

  • @jescarchambeshi
    @jescarchambeshi 4 หลายเดือนก่อน

    Thank you very much, you saved me😩💝💝

  • @peaceandlove11-h2b
    @peaceandlove11-h2b 2 ปีที่แล้ว +1

    this is so helpful thank you very much

  • @rivers3408
    @rivers3408 10 หลายเดือนก่อน

    Im learning!!!

  • @joeyroberts9443
    @joeyroberts9443 10 หลายเดือนก่อน

    ur so clutch

  • @oa213
    @oa213 2 ปีที่แล้ว

    Thank you :)

  • @ravindrakhakural6757
    @ravindrakhakural6757 2 ปีที่แล้ว

    Great Explanation Professor , Lets buy some beers :)

  • @user-ri2kn4hy7y
    @user-ri2kn4hy7y 7 หลายเดือนก่อน

    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?

    • @SpartanProfessor
      @SpartanProfessor  6 หลายเดือนก่อน

      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.

  • @omkarkudalkar4621
    @omkarkudalkar4621 3 ปีที่แล้ว

    thankss

  • @kevaldevkar751
    @kevaldevkar751 2 ปีที่แล้ว

    I know it is a silly question but why have you add 1 in the statements??

    • @obaidrehman773
      @obaidrehman773 ปีที่แล้ว

      So that at the end the value of year will tell you how much years have passed to reach that condition

  • @aaronpicking4935
    @aaronpicking4935 ปีที่แล้ว

    Tau beta pi!

  • @samterrell3265
    @samterrell3265 5 หลายเดือนก่อน

    Good explanation just stop being such a robot 😭