Welcome to Westonci.ca, the ultimate question and answer platform. Get expert answers to your questions quickly and accurately. Get accurate and detailed answers to your questions from a dedicated community of experts on our Q&A platform. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.

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