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 commentaires

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 le 22 Fév 2015
Also, what does 13.68e6x mean? How about 13.68 * 10^(6*x) or maybe 13.68 * exp(6*x)?

Connectez-vous pour commenter.

 Réponse acceptée

Image Analyst
Image Analyst le 22 Fév 2015
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;

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by