function [share]=consshare(supply,q) % share: how much of the expenditures in (column) go to (row)?. global N tau lambda; for column=1:N for row=1:N rawshare(row,column)=supply(row)*exp(-lambda*q(row)*tau(row,column)); end end for column=1:N share(:,column)=rawshare(:,column)/sum(rawshare(:,column)); end return