Currency conversion using matlab script - i have no idea how to start with this
Show older comments
Write a MATLAB script to display currency conversion for US Dollar, British Pound, Euro with Singapore Dollar as the base Currency. Your output should show the equivalent values for USD, GBP, EURO for every Singapore dollar in increments of 1 dollar until 25 dollars.
Sample Output to be as follows:
SGD USD GBP EURO
1 - - -
2 - - -
3 - - -
..
..
25 - - -
Answers (2)
SGD2X = [0.70991 0.23 5.3444 9.000]; % put the actual values here to convert from Singapore Dollars to USD, British Pound etc.
T = T = (1:25)'*SGD2X
4 Comments
rayner lee
on 14 Sep 2015
Edited: Walter Roberson
on 14 Sep 2015
rayner lee
on 14 Sep 2015
Edited: Walter Roberson
on 14 Sep 2015
The cumsum(ones(25,1)) just generates the numbers from 1 to 25. I replaced above with 1:25. ones and cumsum are basic matlab commands. You can find out about them using help.
To display the output you can use disp. Just add a column of the values 1:25 in front of T
disp('SGD USD GBP EURO')
disp([[1:25]' T])
Categories
Find more on Enterprise Deployment with MATLAB Production Server in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!