필터 지우기
필터 지우기

Plotting the R(n) and compute n

조회 수: 3 (최근 30일)
James
James 2013년 9월 24일
댓글: James 2013년 9월 30일
Help please im so lost
Let Rn denote the equivalent resistance of n resistors connected in parallel, each having resistance R for n = 1, 2, 3, etc. It can be shown that Rn is governed by the following recursive relation:
R(n+1) = R(n)R/R(n), where n = 1,2,3,... with R1 = R (a) Given R = 10kΩ, write a MATLAB program to plot Rn versus n for n = 1, 2, . . . , 100. (b) For a given R and a positive integer m, write a MATLAB function that utilizes the while loop to compute n such that Rn = 10−mR.
  댓글 수: 1
James
James 2013년 9월 30일
편집: James 2013년 9월 30일
I got part a but Im stuck on part b
function [R] = func(m)
r = 10000;
while (m ~= 0)
R = (10^(-m)*r);
m = m - 1;
end
this is my code it keeps giving me the error and im not sure why EDU>> func(m) Undefined function or variable 'm'.

댓글을 달려면 로그인하십시오.

답변 (1개)

Honglei Chen
Honglei Chen 2013년 9월 30일
You need to pass in a number or define m first, for example
m = 3
func(m)
  댓글 수: 1
James
James 2013년 9월 30일
Thanks for the help but im still getting the same error where would you put the info that you provide in my code? Im probably over thinking this.

댓글을 달려면 로그인하십시오.

카테고리

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