loops in matlab

조회 수: 5 (최근 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에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by