Help An asighment about Matlab programing

  • Context: MATLAB 
  • Thread starter Thread starter kidd
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

The discussion focuses on a MATLAB programming assignment requiring the simulation of multiple point charges in free space. The specific charges and their positions are Q1 = 5μC at (9,6,8), Q2 = 9μC at (6,8,5), Q3 = 6μC at (8,5,9), and Q4 = 8μC at (5,9,6). Participants suggest creating an array in MATLAB to manage charge values and calculating the resultant electric field for a 7μC point charge at (-1,4,8). The output must be formatted as Axâx + Ayây + Azâz, and users express frustration over the tight deadline and lack of prior MATLAB experience.

PREREQUISITES
  • Basic understanding of electric fields and point charges
  • Familiarity with MATLAB programming environment
  • Knowledge of arrays and mathematical operations in MATLAB
  • Concept of electric field calculation from multiple charges
NEXT STEPS
  • Learn how to create and manipulate arrays in MATLAB
  • Study the calculation of electric fields from point charges in MATLAB
  • Explore MATLAB's command window for output display
  • Understand the syntax for vector representation in MATLAB
USEFUL FOR

Students in physics or engineering courses, particularly those tasked with programming assignments in MATLAB, and anyone needing to simulate electric fields from multiple point charges.

kidd
Messages
14
Reaction score
0
Help~~An asighment about Matlab programing!

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

Procedure:
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:
Physics news on Phys.org
By simulate I am going to 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

Q=mew*C;

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
 
dont understand!I don't 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...
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
4K
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K