How can I present time variant equation in Matlab

2 ビュー (過去 30 日間)
Adham Ahmed
Adham Ahmed 2023 年 1 月 25 日
回答済み: Piyush Patil 2023 年 3 月 1 日
How can I present time variant equation in Matlab
for example it F(x)=x^2+3x+4
how to present F(x,t)
  5 件のコメント
Adham Ahmed
Adham Ahmed 2023 年 1 月 25 日
How about Z=(f(x),t)
Dyuman Joshi
Dyuman Joshi 2023 年 1 月 25 日
Give an example for Z as a function of f(x) and t, and once again, explicitly specify what you mean by 'to present'.

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

採用された回答

Piyush Patil
Piyush Patil 2023 年 3 月 1 日
Hello Adham,
I am assuming that you want to define a function of type – z(f(x), t).
So here, you are having a function ‘z’ that depends on f(x) and t. You can represent ‘z’ using an anonymous function with two input arguments – x and t.
Let’s consider an example –
z(f(x), t) = f(x)*t + t^2
and
f(x) = x^2 + 3*x + 4
You can define z and f as follows -
% Define the function f(x)
f = @(x) x^2 + 3*x + 4
% Define the function z(f(x), t)
z = @(x, t) t*f(x) + t^2;
% Evaluate the function Z at x = 2 and t = 3
z(2,3)
You may refer to the following link to know about the usage of anonymous functions - Anonymous Functions

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by