Info
この質問は閉じられています。 編集または回答するには再度開いてください。
how can i solve this one below?!! PS: the most important to me is to know how to take the values from the user and put them into a matrix and please i want the simplest way for it
1 回表示 (過去 30 日間)
古いコメントを表示
Your function takes an input Q of different discrete charge distribution in 2D plan, Q is a Nx3 matrix, where each row represents on charge, the first entries of a row is the charge position in the xy plan, and the last entry is charge value. The function will return one position of minimum electric field rounded to the second number after the decimal point. To keep the problem simple, assume our space only spans from (0,0) to (10,10).
0 件のコメント
回答 (2 件)
Star Strider
2014 年 12 月 28 日
If your most important concern is the best way to get the input from the user, I would use the inputdlg function. It is not only intuitive, it avoids Command Window pollution.
Putting the responses into a matrix that your routine can use is a small software engineering problem that you are more than capable of solving yourself.
0 件のコメント
Shoaibur Rahman
2014 年 12 月 28 日
N = input('N=');
for i = 1:N
for j = 1:3
A(i,j) = input(['row ',num2str(i),' and column ',num2str(j),' element: ']);
end
end
A
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!