Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help An asighment about Matlab programing!

  1. Aug 16, 2005 #1
    Help~~An asighment about Matlab programing!

    I dont know how to do this!!I never lern Matlab, i have try to use it, but dont know y cannot compile!Please help me do this assighment,i need to pass up it at tomorrow morning.....

    1.Write a program to simulate the interaction of multiple charges in a free space.
    2.The charge and position carry by each point charges as follows

    Q1 = [tex]5\mu C[/tex] at the position(9,6,8)
    Q2 = [tex]9\mu C[/tex] at the position(6,8,5)
    Q3 = [tex]6\mu C[/tex] at the position(8,5,9)
    Q4 = [tex]8\mu C[/tex] at the position(5,9,6)

    3.Find the resultant electric field aon a [tex]7\mu C[/tex] point charce at (-1,4,8)

    4.Result of electric must in the form of [tex]A_{x}\hat{a}_{x}+A_{y}\hat{a}_{y}+A_{z}\hat{a}_{z}[/tex]

    5.Write explanation of the program listing.

    PLEASE!!!!PLEASE!!!Anyone know how to do it,please help me write this program!!Thank you....
    Last edited: Aug 16, 2005
  2. jcsd
  3. Aug 16, 2005 #2
    By simulate Im gonna assume you are saying calculate.

    In this case you will need an array of values for C

    eg. This is how you create an array.

    Goto file>new>mfile

    C=[1 2 3 4 5 6 7 8 9 10]; etc

    then you need to identify what mew is by;

    mew=(Whatever mew is);

    then type in the formula such as


    when you run this it should give you another array with the answers up in the command window.

    How come you have been asked to use matlab if you have never done it before?

    hope this helps for Q1
  4. Aug 16, 2005 #3
    dont understand!!I dont know the language of matlab....I just know VB and C++....
    My lecturer ask us for this...he require us to lern, but more few days is end test already!No more time to lern it....
    Please help me....Please.....
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook