フィルターのクリア

Help With plotting 3D Graph

2 ビュー (過去 30 日間)
Mark Dawson
Mark Dawson 2020 年 12 月 3 日
コメント済み: Mark Dawson 2020 年 12 月 3 日
Say I have a function psi, given as a series of x values and time.
psi=@(t)(abs(x_1.*exp(((-(t.^2))./(x_3.^2))+((i*x_4.*(t.^2))/(2))+(i*x_6))));
x_3, x_4 and x_6 and t are matrices of length 2000.
I need to calculate psi for every value of t.
So Like:
psi(1) = abs(x_1.*exp(((-1)./(x_3.^2))+((i*x_4)/(2))+(i*x_6))));
I get 2000 values. But i need to do this for 2000 values of t.
So psi needs to be a 2000x2000 matrix.
Annoyingly, ive got the concepts down, but the syntax is stumping me.

採用された回答

Stephan
Stephan 2020 年 12 月 3 日
編集済み: Stephan 2020 年 12 月 3 日
Use:
t=t.';
then call
Result = psi(t)
Also make sure that t is length needed --> here 2000
  1 件のコメント
Mark Dawson
Mark Dawson 2020 年 12 月 3 日
Hi steven, inverting the t matrix worked a charm. I was overcomplicating it with multiple for loops, which causwd my laptop to crash.
You wnat a good laugh? I saw this answer two houors ago, and then spent the following two hours trying to plot using plot3, only to figurre out i neeeded mesh about ten minutes ago.
Im tired, im off for a nap. thanks man.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by