How to solve for a range of values
조회 수: 7 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
