×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

3D Magnetism Plot in Matlab

3D Magnetism Plot in Matlab

3D Magnetism Plot in Matlab

(OP)
sorry, another newbie question.

i fully understand how a curve should look, and how to use meshgrid, mesh etc. problem is, i cant get my problem translated into matlab.

in 2D - the curve is a straight line
(1) y = mx for 0 < x < r (r being some constant)

then once x = r, the curve is an exponetial, along the lines of
(2) y = 1/x

the problem is, i need this in 3D. from the top view, the plot must be a circle. as the circle expands, the z-axis follows the 2D curve. u could imagine its like a donut, the middle is not quite empty, but its height is low. as u expand from the centre of the donut, the hight increases. once u get to the edge of the donut tho, the height falls away rapidly.

i hope people can understand this. if anyone has done a bit of magnetism, it's the plot of magnetic flux density B, of a circular current carrying conductor with radius r.

RE: 3D Magnetism Plot in Matlab

(OP)
ok, i figured it all, so no need to worry.
cept theres a new problem thats bugging me:

iv created a GUI so users can input parameters like current, radius etc... i then need these values to plot the curve. so for example iv sed:

current = get(handles.editCurrent,'String');
inRad = get(handles.editInRad, 'String');
muR = get(handles.editInMuR, 'String');
% display values in command window
muR
inRad
current

- if i simply display them, the values i enter r exactly the same. the problem occurs wen i use the values. if i multiply muR by inRad for example, it turns out to be a 1x4 vector!!! somewhere three extra values got put in.
i hav noticed it only happens if i make the values more than one digit.
eg if i use '1' or '5', there is no problem but '0.05' or '2000' tend to get all messed up. any ideas
thanks.

RE: 3D Magnetism Plot in Matlab

You're inputting strings; you need to convert to *real*

TTFN



RE: 3D Magnetism Plot in Matlab

(OP)
shot bud,
i tried

inRad = inRad + 0.0;

etc, im guessing thats the best way to convert?
well it works, so thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources