How to write this formula in code and plot in matlab?
Show older comments
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 Comments
Glo
on 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
on 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().
Accepted Answer
More Answers (0)
Categories
Find more on White in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!