Solution Library

Find Out Values of Variables Using MATLAB


Given two variables A and B, swap their values. You should not assume that you know what the values in A and B are, or even that they’re scalar values.

  1. Hint: You will need a 3rd, temporary variable
  2. Test your script with A = [4 5 2] and B = [6 1 7 9]
  3. Print out the values of A and B before the swap using fprintf.
  4. Print out the values of A and B after the swap using fprintf.



This question belongs to MATLAB software and discusses about application of MATLAB in mathematics to find out values of two given variables.





Download Full Solution


  • HWA

    this is a very good website

  • HWA

    I have 50 questions for the same test your page is showing only 28

  • HWA

    hi can you please help or guide me to answer my assignments. thanks

  • HWA

    hi can anyone help or guide me to my assignments. thanks

  • HWA

  • HWA

    This solution is perfect ...thanks

  • HWA

    Hello Allison,I love the 2nd image that you did! I also, had never heard of SumoPaint, is something that I will have to exolpre a bit! I understand completely the 52 (or so) youtube videos that you probably watched. Sometimes they have what you want, sometimes they don't! However, it is always satisfying when you are able to produce something that you have taught yourself. Great job!Debra 0 likes

  • HWA

    Perfect bank of solution. 

  • HWA

    great !

  • HWA
    Paul Brandon-Fritzius

    thanks for the quick response. the solution looks good. :)

  • HWA
    tina Johnson

    thnx for the answer. it was perfect. just the way i wanted it. 

  • HWA

    works fine.