Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have solution for the for asignment , I need help with asignment 5 in matlab coding or if you can do it all 5

I have solution for the for asignment , I need help with asignment 5 in matlab coding or if you can do it all 5 again in matlab!

Task 1: Play with the MATLAB environment and check the variables and understand program. Check out the comments which explains the variables that match some text and equals it to a value. Note the lines with semicolon and the lines without. Try to evaluate a particular selection i.e. instead of running the entire code, try to run selected lines of code. To do: Type whos in the command window to check the list of all variables in the matlab workspace. Task 2: Calculate your net expenses and per day expenses. Fill in a value for how much you want to invest for the retirement. This can be an absolute value or a proportion of your income. To do: Derive your Net_expenses by inputting a proportion of income as retirement savings. Calculate the nonessentials which ideally should be the difference between your income and expenses. Calculate per day expenses by dividing the net expenses by 30. Task 3: Display the final output in command window. The square brackets help in concatenating strings and variables. To do: The final display should be: I can spend X value per day Where X = the perday expense calculated. Task 4: Calculate what happens when you spend twice the amount during the weekend as during the week Note: You can try to divide the nonessential expenses into 3 parts i.e. 2 parts for the weekend and 1 part for the week. To do: Print the final display along with the calculated value of how much can you spend during the weekend and how much can you spend during the week day. Task 5: Work on the overall budget including your net income, such that you can spend about $100 additionally per day.

% taking as input from user income = input('enter your income per month '); % asking user for the proportion of income for retirement savings retirement_percent = input('enter % of income for retirement savings per month '); % asking user as input for total expense per month expense = input('enter your expenses per month '); % calculating nonessential expense by substracting retirement savings percent % and total monthly expenses from income per month nonessential_expense = income - income*retirement_percent/100 - expense; % calculating nonessential_expense per week nonessential_expense_perweek = nonessential_expense/4; % calculating nonessential_expense on weekdays nonessential_expense_weekdays = nonessential_expense_perweek/3; % calculating nonessential_expense on weekends nonessential_expense_weekends = nonessential_expense_perweek*2/3; % calculating net expense by adding essential and non essential expenses net_expense = expense + nonessential_expense; % per day expense by dividing monthly expense by 30 per_day_expense = net_expense/30;

%money that can be spend during weekdays per week fprintf('money which can be spend during weekdays %f per week ',nonessential_expense_weekdays); %money that can be spend during weekends per week fprintf('money which can be spend during weekend %f per week ',nonessential_expense_weekends);

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

Lords Of Finance The Bankers Who Broke The World

Authors: Liaquat Ahamed

1st Edition

0143116800, 978-0143116806

Students also viewed these Databases questions