Plot of Magnetization Vs Magnetic Field

3 ビュー (過去 30 日間)
Offroad Jeep
Offroad Jeep 2016 年 2 月 3 日
コメント済み: Star Strider 2016 年 2 月 4 日
Dear Matlab Users, Hi to All, I have tried to plot the magnetization Vs Magnetic field. when the magnetic field is reduced the magnetization starts to randomize and also tends to go to zero but do not go to zero exactly for which probability is also used. For every value of B there is value of magnetization.
The graph should be between magnetic field and magnetization( In my graph i am getting one point only)
THANKING YOU ALL IN ANTICIPATION

採用された回答

Star Strider
Star Strider 2016 年 2 月 3 日
You set:
B = 2;% Tesla Initial Magnetic Field
early in your code, and then you iterate this loop:
for i = 1 : length(B)
precisely once as the result, so that:
magnetization_new(i) = magnetization * cosd(theta_new);
is calculated only once, and:
plot(B,magnetization_new,'-*')
plots the one point you told it to plot.
I removed the subscript from ‘magnetization_new’ in the plot call because when you re-write your code and get vectors for ‘magnetization_new’ and ‘B’, that will throw an error because you will be plotting the vector of ‘B’ against only the last element of ‘magnetization_new’.
Beyond that, I don’t know what you’re doing so I can’t suggest a way to fix your code.
  4 件のコメント
Offroad Jeep
Offroad Jeep 2016 年 2 月 4 日
ok i will send you the algorithm which i am trying to simulate hope that will help you to get an understanding what i want to do and where my loop is not correct
Star Strider
Star Strider 2016 年 2 月 4 日
I cannot promise anything other than I will look at it and do my best to help.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by