- #1
Chado
- 1
- 0
Hey, everyone. I need to finish this project and it would be a great help if there was some help. The problem is I have no experience with countourf function of MATLAB but I was asked to transform a physics exercise to it.
In the spoilers there will be all of the problem solved.
Also once I get there I will way what were my problems as I tried to type it in matlab.
1) What's the general expression of a dipole in a random spot? (I will give this further on)
2) Create a program (or an mfile) that will picture the field on the space.
The above means to unite all the points that equal with contourf, in a faction that two circles will be created and will show the field.
We were told to use in the pc :
y=[ -5*d : d/1000 : 5*d]
x=[ -5*d : d/1000 : 5*d]
z= [i,j] which is = Eg and that the i and j will behave like I=0 , i=i+1 and j=j+1
and all the above will be put in the contourf.
If you open the open office file (it's in .doc for the Word users) I used the Math to give the huge funcion.
I tried to break it down in pieces and the do build it but again
here is one of those :
E1=((x-d/2)/(((x-(d/2)).^2).^(3/2)))- ((x+d/2)/((((x+(d/2)).^2)+y^2).^(3/2)))
But MATLAB give me back :
? Error using ==> mpower
Matrix must be square.
You might ask:
What are you asking ?
1) what's i the mistake I did and the error pops up?
2) How will I use the contourf to give me result i want ?
Thanks in Advance.
(Note: I will edit the graph if needed and the previous parts of the final function, just in case i did a mistake.)
In the spoilers there will be all of the problem solved.
Also once I get there I will way what were my problems as I tried to type it in matlab.
1) What's the general expression of a dipole in a random spot? (I will give this further on)
2) Create a program (or an mfile) that will picture the field on the space.
The above means to unite all the points that equal with contourf, in a faction that two circles will be created and will show the field.
We were told to use in the pc :
y=[ -5*d : d/1000 : 5*d]
x=[ -5*d : d/1000 : 5*d]
z= [i,j] which is = Eg and that the i and j will behave like I=0 , i=i+1 and j=j+1
and all the above will be put in the contourf.
If you open the open office file (it's in .doc for the Word users) I used the Math to give the huge funcion.
I tried to break it down in pieces and the do build it but again
here is one of those :
E1=((x-d/2)/(((x-(d/2)).^2).^(3/2)))- ((x+d/2)/((((x+(d/2)).^2)+y^2).^(3/2)))
But MATLAB give me back :
? Error using ==> mpower
Matrix must be square.
You might ask:
What are you asking ?
1) what's i the mistake I did and the error pops up?
2) How will I use the contourf to give me result i want ?
Thanks in Advance.
(Note: I will edit the graph if needed and the previous parts of the final function, just in case i did a mistake.)