loops in matlab
1 次查看(过去 30 天)
显示 更早的评论
Hi there, a matlab question involving the loops.Here is the question:
Electrical resistors are said to be connected in series if the same current passes through each and in parallel if the same voltage is applied across each.
If in series,they are equivalent to a single resistor whose resistance is given by:
R=R1+R2+R3+....+Rn
If in parallel,their equivalent resistance is given by:
1/R =1/R1+1/R2+1/R3+....+1/Rn
a)Write a function that uses the type of connection and resistances R1 to Rn as inputs to compute equivalent resistance R
b)Write an M-file that prompts the user to enter the type of connection(series/parallel),hw many individual resistances will b used(n).based on the value of n,program should prompt the user n times to enter the individual resistances R1,R2,......Rn.M-file should then recall function in part a)to get equivalent resistance R.
I badly need help for this part :((
1 个评论
Jiro Doke
2011-4-5
Hmm, similar homework question as this...
http://www.mathworks.com/matlabcentral/answers/4696-subfunctions-urgent-help-needed
Instead of just pasting questions, please show the work that you have done, and ask *specific* questions. Also read my answer from here. There are a lot of resources to help you get started if you don't know where to start:
http://www.mathworks.com/matlabcentral/answers/4606-how-to-find-sufficient-help-in-matlab-important-matlab-admin
回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!