How to write this formula in code and plot in matlab?

Hi,
I want to calculate B field for receive only coils with the help of this formula.
B1=1/2(Bx−jBy)
I will be needed to plot the graph too. So, how to express it in code for Matlab to run. Thanks in advance. I am really new so I know this question will be like silly one.
Anyway. THanks in advance.

2 commentaires

Glo
Glo le 2 Jan 2015
1. decompose your original formula into real and imaginary parts, i.e. a + jb 2. Whatever values you want to plot for Bx and By, save them in a vector array e.g. B_x and B_y 3. Multiple each element of vector B_x and B_y with a and b respectively and save them in another array 4. plot them on x-y axis
Glo
Glo le 5 Jan 2015
Ok, I would like to clarify what I meant. You have 2 arrays Bx and By (your source data). As according to the formula coefficients of 'j', will be the By array. The quantity B1, which you are trying to plot is a complex number, which cannot be represented on a single line, hence, a 2-D plane is required to plot 1 point value of B1. (Bx values on x-axis and By values on y-axis). That is why it is important to separate real and Imaginary parts, and scale them accordingly. (in your case divide by 2). That is why I told you to use another array in which Bx and By are scaled, and you just need to use plot().

Connectez-vous pour commenter.

 Réponse acceptée

Actually this is:
B1 = (Bx - jBy) / 2
But the meaning of Bx and jBy is not clear, so I assume that this answer is not useful for you. Please provide more information to allow for an efficient answer.

2 commentaires

John, did you provide Bx and By, like he asked? No. And I have no idea what that image is. Why is it a quadrilateral? What's with the dark blue segments that leave and re-enter the image? I have no clue, because you didn't provide any. Somehow you got B1 and list it in the colormap tickmarks (for some reason). But you say you want to plot those values, so why don't you just do plot(B1)? Here, read this and re-state your question.
We can't run your code because we don't have the data or functions.

Connectez-vous pour commenter.

Plus de réponses (0)

Question posée :

le 2 Jan 2015

Commenté :

Glo
le 5 Jan 2015

Community Treasure Hunt

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

Start Hunting!

Translated by