Hello, I am trying to solve an equation involving two vectors.
1 view (last 30 days)
Show older comments
Charles Naegele
on 18 May 2018
Commented: Charles Naegele
on 18 May 2018
I have vector P (3000x1) and T (1x3000). I plotted P vs. T just fine. Now, I have to solve an equation, tau = -T/ln(P/P(0)) I tried this, but it returns 3000 numbers:
if true
% code
end
for i = 1:3000
tau(i) = -T(i)/log(P(i)/P(1));
end
5 Comments
Accepted Answer
Star Strider
on 18 May 2018
tau = -T / log(P')/P(1);
Note the transposition (') operator to create a row vector from ‘P’. That will give you a single value for your ‘tau’ parameter.
2 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!