How to Store Output Values from All Iterations of a For Loop in MATLAB | Preallocation Part 1

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

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

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

    I hope this has been helpful. If you haven't already, please SUBSCRIBE!!!
    Preallocation Part 2: th-cam.com/video/IFd6r3XQJbI/w-d-xo.html
    Here is the link to the previous video on the basics of for loops: th-cam.com/video/t59XztE9EPU/w-d-xo.html

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

    Wow you are my savior, It's 10:30 on a saturday because i figured taking a break was a good idea and this video, and your excellent explanations about the littlest things (which was incredibly useful because I tend to forget things) has saved my ass from this matlab assignment

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

      Glad the video helped :)

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

    Great explanation, kudos!

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

    This have been very uselful, Thank you so much!

  • @AlirezaSheida
    @AlirezaSheida 11 หลายเดือนก่อน +2

    god bless you man!

    • @EHbhuiyan
      @EHbhuiyan  11 หลายเดือนก่อน

      :)

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

    I really liked the way u explained

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

      Glad I could help :)

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

    Thank you. But my issue is, I want to store output values into an array of unknown size! There seems to be no MATLAB equivalent to ".append()" where we can append values into an array without redefining the size of the array. Can anyone help me here?

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

      same here. i have an if statement inside my for loop, so the size of the end array is generally unknown. it doesnt help im a matlab beginner...

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

      hi, after some googling i somehow found a solution haha. so here is an example:
      pressure = [] %define an empty array
      for i=1:10 %execute the for loop for desired columns in a 2d array/matrix
      if T(row,i)~=0 %define a condition
      p=T(row,i); %what happens if the statement is true
      pressure=[pressure,p]; %append the p value to the empty pressure array
      end
      end

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

    I Love it

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

    Can you please do a video of solving systems of nonlinear equations with multiple variables using LSQNONLIN

  • @ManishKumar-xc7zq
    @ManishKumar-xc7zq ปีที่แล้ว

    Sir how can I print the each iterative value in loop....
    I.e. -we have to print individually y(1)=0
    y(2)=3
    ......
    y(11)=30
    Sir please I am waiting this side....I have to use in our ph.d program

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

    Sir, can you please send the link to Part 2 of the same video??

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

      Here is Preallocation Part 2: th-cam.com/video/IFd6r3XQJbI/w-d-xo.html

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

    👍🙏