Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm trying to make an app in MATLAB's app designer that pulls values of current exchange rates from online sources, but the url shown below

I'm trying to make an app in MATLAB's app designer that pulls values of current exchange rates from online sources, but the url shown below doesn't seem to work for me and I do not know how I would be able to import these values to begin with. The function for getExchangeRate has filler values that I would like to have be replaced with the values that get updated consistently.

image text in transcribed % Button pushed function: ConvertButton function ConvertButtonPushed(app, event) USDAmount = app.AmountEditField.Value; selectedCurrency = app.CurrencyDropDown.Value; exchangeRate = getExchangeRate(selectedCurrency); convertedAmount = USDAmount exchangeRate; app.Label_2.Text =sprintf(%0.2f%s, convertedAmount, select % % % % % % % % % % url = 'https://wWW.x-rates.com/table/?from=USD\&amount=1'; htmlContent = webread(url); currencyPattern = '>span class=" currency-value" >(. ? ) span>' currencyMatches = regexp(htmlContent, currencyPattern, 'tokens usdValue = str2double (currencyMatches {1}{1}); eurValue =str2 double ( currencyMatches {2}{1}); convertedAmount = convertCurrency (app, USDAmount, selectedCurr function rate = getExchangeRate(currency) switch currency case 'EUR ' rate=0.91795; case 'GBP' rate=0.78917; case 'INR ' rate=83.0166; case 'AUD' rate=1.49196; case 'CAD' rate=1.33729; case 'SGD' rate=1.33327; case 'MYR' rate=4.67098; case 'CHF

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

I receive useful feedback about my performance.

Answered: 1 week ago

Question

I am encouraged to offer opinions/suggestions.

Answered: 1 week ago