Skip to main content

Posts

Showing posts from November, 2015

Convert from Degrees Fahrenheit to Degrees Celsius using Matlab

Problem Create a variable ftemp to store a temperature in degrees Fahrenheit (F). Convert this to degrees Celsius (C) and store the result in a variable ctemp. The conversion factor is C  =  (F – 32) * 5/9. Solve this problem using Matlab.  Solution This problem has been taken from the book Matlab: A practical introduction to programming and problem solving . This book is really awesome book. The author assumes zero knowledge to programming. This book starts from variables and continues to Graphic User Interface using Matlab . Image processing using Matlab is also included in this book. I suggest you go through this book if you don't have any knowledge programming in Matlab or if you want to become an expert from Novice in Matlab programming. Coming back to solving the above problem, in the question it was asked to to convert from degree Fahrenheit to degree Celsius using the conversion factor. This is similar to my previous post: Weight Conversion Ki...

Weight converter Kilograms to Pounds: Matlab

Problem Create a variable kilos to store the weight in kilograms and convert it into pounds using Matlab. Show the result in a neat text fashion. The conversion factor is 1 Pound = 0.453592 Kilograms. Solution This problem has been a sequel of the recent post on radiusofcircle.blogspot.com and can be found here: Weight to convert Pounds to Kilograms . This post is similar to that and if you have solved the prequel post then I suggest you to solve this problem by your own and verify the solution with the one posted here. In this problem we will request the user to input the value of the weight in kilograms and store it in a variable . Now we will use the conversion factor and store the value of the result in another variable . We will finally display the value to the user.Some of the key concepts in that you need to know in Matlab to solve this problem are as follows: 1) Input function in Matlab 2) Matlab Variables 3) fprintf function in Matlab (OR) 4) disp function...

Where does dishonesty start?

Now a days we see many people not being honest or being dishonest to others and not everyone knows that, these people who are not honest to others are not honest to themselves. Before we proceed further let me explain you what honesty in my context mean. According to me being dishonest or not being honest is like cheating yourself at first then people around you, then your nation and finally the whole world. Some of the examples of dishonesty are like not completing the job assigned to you, telling a lie to others, cheating your parents and many more. So how one person being dishonest does have an effect on whole world? Dishonesty is like a virus which will never leave until you will face a failure in your life. It will also spread from one dishonest person to a person who is honest. To make it simple let us consider a person who is a dishonest cop whose name is Donest. One day one person approaches this person in the police station stating that he has lost his phone whose name is Nes...

Weight Converter Pounds to Kilograms: Matlab

Problem Create a variable pounds to store weight in pounds. Convert this to kilograms and assign the result to a variable kilos. The conversion factor is 1 kilogram = 2.2 pounds. Solve using Matlab Solution This problem has been taken from the book written by Stomy Attaway. This is a problem in the first chapter. This book is really great for the beginners to become a professionals in Matlab. I seriously recommend reading this book:   Matlab, Third Edition: A Practical Introduction to Programming and Problem Solving . Okay lets go into the solution. This is a very basic problem and can be solved in many different ways. We will solve this problem taking the input from user and then give the output. If you don't understand the problem then go to explanation section below the program section and if you still don't understand then check out these links which will give teach you about the basics behind this program. 1) Input in Matlab 2) Variables in Matlab 3) fprintf...

projecteuler.net problem 8 MATLAB Largest product series

Problem The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 12540698747158523863050715693290963295227443043557 66896648950445244523161731856403098711121722383113 62229893423380308135336276614282806444486645238749 30358907296290491560440772390713810515859307960866 70172427121883998797908792274921901699720888093776 65727333001053367881220235421809751254540594752243 52584907711670556013604839586446706324415722155397 53697817977846174064955149290862569321978468622482 83972241375657056057490261407972968652414535100474 82166370484403199890008895243450658541227588666881 16427171479924442928230863465674813919123162824586 17866458359124566529476545682848912883142607690042 24219022671055626321111109370544217506941658960408 071984038509624554443629812309878799272442849091...