At Westonci.ca, we provide reliable answers to your questions from a community of experts. Start exploring today! Experience the convenience of getting accurate answers to your questions from a dedicated community of professionals. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

Function newPriceTable = UpdatePriceTable(origPriceTable, changePrice, colNum) % UpdatePriceTable: Adds changePrice to column colNum of origPriceTable % Returns the updated price table newPriceTable % Inputs: origPriceTable - original price data table % changePrice - column array of pricing changes % colNum - specified column of priceTable to update % % Outputs: newPriceTable - updated price data table % Assign newPriceTable with data from priceTable; newPriceTable = [0, 0; 0, 0;]; % FIXME % Assign newPriceTable column specified by colNum with original price % data updated by changePrice newPriceTable = [0, 0; 0, 0;]; % FIXME end Run Your Solution Code to call your function when you click Run

Sagot :

Solution :

The function code is :

function newPriceTable = UpdatePriceTable(origPriceTable,changePrice, colNum)

newPriceTable = origPriceTable:

newpriceTable(:,colNum) = newPriceTable(:,colNum)+changePrice;

end

UpdatePriceTable ([19.99, 9.99; 14.99, 8.99;], [-1.00, -1.50] , 1)

ans = 18.9900      9.9900

         13.4900      8.9900