How to solve for a range of values

조회 수: 7 (최근 30일)
Richard Baird
Richard Baird 2021년 3월 31일
답변: Walter Roberson 2021년 3월 31일
I have a very simple expression with 2 variables , R1 and R2, that depend on each other. I want to plot the solution for R2 given a range of values for R1.
Here is what I have so far:
syms R2 positive
V = -9;
R1 = [100:100:1e6];
EQ = V.*(R1./(R1 + R2)) == -2.3;
plot(R1,solve(EQ,R2)) % produces an error, vectors must be of the same length

채택된 답변

Walter Roberson
Walter Roberson 2021년 3월 31일
syms r1 r2 positive
V = -9;
R1 = [100:100:1e6];
EQ = V.*(r1./(r1 + r2)) == -2.3;
R2sol = solve(EQ,r2);
R2 = double(subs(R2sol, r1, R1));
plot(R1, R2)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by