plotting a mathematical expression

3 ビュー (過去 30 日間)
NILESH PANDEY
NILESH PANDEY 2016 年 11 月 23 日
コメント済み: Star Strider 2016 年 11 月 24 日
i am plotting a mathematical code phi_u given in attached file i observed that values of o and p are changing w.r.t x but values of t is keep coming constant sames goes to e and f are changing but g coming constant because of this phi1 and phi2 are constant and so phi_u is constant and i am getting a straight line. how this can be done so that phi_u vary w.r.t x?
one more thing if i use u*u or x*x in expression i get the error inner matrix dimension must be agree so i used power(u,2) why this

採用された回答

Star Strider
Star Strider 2016 年 11 月 23 日
I will not re-post your entire code, only the lines you need to change:
j=(1-k*u)./sqrt(k-k*k*power(u,2)); % <— USE ELEMENT-WISE DIVISION OPERATOR HERE
l=(1-u)./sqrt(1/k-power(u,2)); % <— USE ELEMENT-WISE DIVISION OPERATOR HERE
e=(1+k*u);
f=sqrt(k-k*k*power(u,2));
g=e./f; % <— USE ELEMENT-WISE DIVISION OPERATOR HERE
m=(1+k*u)./sqrt(k-k*k*power(u,2)); % <— USE ELEMENT-WISE DIVISION OPERATOR HERE
n=(1+1*u)./sqrt(1/k-power(u,2)); % <— USE ELEMENT-WISE DIVISION OPERATOR HERE
I do not know what result you expect, but this will plot a curve of the sort I believe you want.
For further reference, see the documentation on Array vs. Matrix Operations.
  2 件のコメント
NILESH PANDEY
NILESH PANDEY 2016 年 11 月 24 日
編集済み: NILESH PANDEY 2016 年 11 月 24 日
Thank you sir this is right. this helped me a lot
Star Strider
Star Strider 2016 年 11 月 24 日
My pleasure.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by