# Find Out Values of Variables Using MATLAB

Question

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.

Summary

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

• Rasha

this is a very good website

• maani

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

• joeanne

• joeanne

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

• Monik

• Cristina

This solution is perfect ...thanks

• Janete

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

• Sandeep

Perfect bank of solution.

• Oxana

great !

• Paul Brandon-Fritzius

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

• tina Johnson

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

• Giuseppe

works fine.