How can I get a profit function P(x,y) using a cost function C(x,y) and a revenue function R(x,y)

2 ビュー (過去 30 日間)
Nouraldeen
Nouraldeen 2022 年 10 月 19 日
コメント済み: VBBV 2022 年 11 月 27 日
So I have 2 multivariable functions, one for cost and one for revenue, and I need to get a profit function. So how do I input a command that basically subtracts the cost function form the revenue function.
R(x,y) = 6xy + x^2
C(x,y) = 2xy+3x^2+y^4

回答 (1 件)

VBBV
VBBV 2022 年 11 月 27 日
編集済み: VBBV 2022 年 11 月 27 日
x = 1; y = 1; % assume some input values
R = @(x,y) 6*x.*y + x.^2; % use funciton handle to define the equations
C = @(x,y) 2*x.*y+3*x.^2+y.^4;
P = R(x,y) - C(x,y) % apply the profit equation
P = 1
  1 件のコメント
VBBV
VBBV 2022 年 11 月 27 日
syms x y % if you have symbolic toolbox access
R(x,y) = 6*x.*y + x.^2;
C(x,y) = 2*x.*y+3*x.^2+y.^4;
P(x,y) = R(x,y) - C(x,y)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by