Lesson 3.4: Sub-functions

Поділитися
Вставка
  • Опубліковано 14 гру 2024

КОМЕНТАРІ • 21

  • @wpouser
    @wpouser 8 років тому +7

    Amazing is how he always ends the videos with a "lika a boss" style, maybe is the music.

  • @sandeeppadmanabhan343
    @sandeeppadmanabhan343 7 років тому +3

    @4:58
    I used sumAllelements(a) instead of sumAllelements(m) and it worked fine.

  • @vishaldeep_deora
    @vishaldeep_deora 5 років тому

    sir i can execute the code in command window with same name of output variables which a used in edit window to define function and i am successfully getting the output?

  • @Abss0966
    @Abss0966 9 років тому

    how do i write a function that does the same thing as fliplr?

  • @siddhivinayak3584
    @siddhivinayak3584 6 років тому

    i dont know why sir
    but i am typing the same code
    but i get error every time
    error in myRand>sumAllelements (line 7)
    summa = sum(V);
    and
    error in myRand (line 3)
    s = sumALLElements(a);
    please help

  • @NidhiSinha4U
    @NidhiSinha4U 7 років тому +2

    v= M (:);
    Summa= sum (v); what does the M imply here??

    • @xinliwang9934
      @xinliwang9934 6 років тому +1

      M is the input of the second function.

    • @Ankur5110
      @Ankur5110 4 роки тому

      As both the functions are different, so both will require different input variables.

  • @disas73r
    @disas73r 8 років тому

    Why do I get a "Maximum recursion limit of 500..." -error?

  • @maurocruz1824
    @maurocruz1824 6 років тому

    Why the "end" just dissapeared?

  • @caspersong8539
    @caspersong8539 8 років тому

    Why cannot I just program like:
    function [a,s]=myRand(low,high)
    a= low + rand(3,4)*(high-low);
    s = sumallelement(a);
    function summ=sumallelement(M)
    summ= sum(v=M(:));

    • @吴京城
      @吴京城 8 років тому +2

      why not, but you'd better write the last line as summ=sum(M(:)), v is meaningless here.

    • @ashishpandita2497
      @ashishpandita2497 7 років тому +1

      You cannot have two expressions in the same statement...you can simply type summ=sum(M(:));....no need of defining v.

  • @skyquake._
    @skyquake._ 4 роки тому

    now lets have sandwich !!

  • @Theodore-Teddy-Roosevelt
    @Theodore-Teddy-Roosevelt 7 місяців тому

    sugma