loops in matlab

1 次查看(过去 30 天)
Durgga Rajendren
Durgga Rajendren 2011-4-5
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
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 个)

Matt Fig
Matt Fig 2011-4-5
Show what you have done so far... and where you are stuck.

Sean de Wolski
Sean de Wolski 2011-4-19

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by