Repetition and Discontinuity Function

10 次查看(过去 30 天)
I want to create a function that evaluates:
v = 1/3.190e9*(800x^3 - 13.68e6x - 2.5x^4 + 2.5<x-120>^4 + 600<x-240<^3)
<x-a>^n = (x-a)^n if x>=a and 0 if x<a
The user would input an array like [0:.5:360]
  2 个评论
Geoff Hayes
Geoff Hayes 2015-2-22
Jorge - what does the syntax
<x-20>
mean to you? What about
600<x-240<^3
Is there a typo in the above or does it have some particular meaning?
Image Analyst
Image Analyst 2015-2-22
Also, what does 13.68e6x mean? How about 13.68 * 10^(6*x) or maybe 13.68 * exp(6*x)?

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2015-2-22
How about
function test
x = [0:.5:360];
a = 10; % Whatever...
v = vx(x, a) % Call the vx function.
function v = vx(x, a)
x(x<a) = 0;
v = (1/3.190e9) * 800 * x .^ 3 - ...
13.68 * 10 .^ (6 * x) - ...
2.5 * x .^ 4 + ...
2.5 * (x - 120) .^ 4 + ...
600 * (x - 240) .^ 3;

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by