Solving an equation with log
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi i'm fairly new to MATLAB and encounter a problem regarding this equation y=c(x)^m
where m is the gradient of points:
(x,1y1)=(100,50)
(x2,y2)=(1000,10)
This is the eq i put on MATLAB:
Eq = log10(Y2) == log10(C1*X2^(m)); %Equation
C1 = vpasolve (Eq, C1)
It seems that i get C far from my hand-drawn answer
How to solve C?
댓글 수: 0
채택된 답변
Walter Roberson
2021년 3월 20일
Looks okay to me.
format long g
X1 = 100; Y1 = 50;
X2 = 1000; Y2 = 10;
m = (Y2-Y1)./(X2-X1);
syms C1
Eq = log10(Y2) == log10(C1*X2^(m)); %Equation
C1sol = solve(Eq,C1)
vpa(C1sol)
%log10(Y2) == log10(C1*X2^m) implies
%Y2 == C1*X2^m implies
C1_numeric = Y2/(X2^m)
댓글 수: 4
Walter Roberson
2021년 3월 20일
Yes, giving you an equation of the form A=B^m with known A and B, which you can use to find m easily.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!