Could someone please point out the error in my code?
Afficher commentaires plus anciens
Write a function called income that takes two row vectors of the same length as input arguments. The first vector, rate contains the number of various products a company manufactures per hour simultaneously. The second vector, price includes the corresponding per item price they sell the given product for. The function must return the overall income the company generates in a week assuming a 6-day work week and two 8-hour long shifts per day.
This was my code:
function [x] = income( rate,price )
c = 0;
d = 0;
rate = [1 1];
price = [2 3];
d = rate.*price;
c = sum(d);
x = 96*c;
end
1 commentaire
John D'Errico
le 16 Oct 2016
Please learn to format your code so it is readable.
1. Select the block of code as you pasted it in.
2. Click on the "{} Code" button.
Done for you today.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Financial Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!