Data type symfun (code problem)
the content of the task:
Follow these steps to obtain expressions for the critical values of f(x)=x^(3/5)*(4-x)^(1/3):
Define the symbolic function f(x) corresponding to the above formula.
Use the diff function to differentiate f(x) and define the symbolic function df(x).
Use the numden function to obtain symbolic expressions for the numerator and denominator of df(x) and store them in the variables n and d, respectively.
Use the solve function to solve the equations n(x)=0 and d(x)=0. Assign them to the nzeros and zeroros variables respectively.
I have a problem, for this task:
Use the solve function to solve the equations n(x) = 0 and d(x)=0.
Here is my code:
syms x
f(x) = x^(3/5) * (4 – x)^(1/3);
df(x) = diff(f(x));
[n d] = numden(df(x));
nzeros = solve(n == 0);
dzeros = solve(d == 0);
%%%%%%% Kod rysujący jest poniżej %%%%%%%%
figure; hold on; grid on;
fplot(f(x),’LineWidth’,2);
fplot(df(x),’LineWidth’,2);
ylim([-6,6]);
legend(‘$f(x)$’,’$f”(x)$’,’Interpreter’,’latex’,’FontSize’,14);
Assign them to the "nzeros" and "dzeros" I can’t write lines 5 and lines 6 of the code correctly
Code error:
Variable n must be of data type symfun. It is currently of type sym. Check where the variable is assigned a value.
I tried replacing the code like this:
syms x
f(x) = x^(3/5) * (4 – x)^(1/3);
df(x) = diff(f(x));
[n d] = numden(df(x));
nzeros = solve(symfun(n,x) == 0);
dzeros = solve(symfun(d,x) == 0);
%%%%%%% Kod rysujący jest poniżej %%%%%%%%
figure; hold on; grid on;
fplot(f(x),’LineWidth’,2);
fplot(df(x),’LineWidth’,2);
ylim([-6,6]);
legend(‘$f(x)$’,’$f”(x)$’,’Interpreter’,’latex’,’FontSize’,14);
However, the same error message keeps popping up.
Can anyone help?the content of the task:
Follow these steps to obtain expressions for the critical values of f(x)=x^(3/5)*(4-x)^(1/3):
Define the symbolic function f(x) corresponding to the above formula.
Use the diff function to differentiate f(x) and define the symbolic function df(x).
Use the numden function to obtain symbolic expressions for the numerator and denominator of df(x) and store them in the variables n and d, respectively.
Use the solve function to solve the equations n(x)=0 and d(x)=0. Assign them to the nzeros and zeroros variables respectively.
I have a problem, for this task:
Use the solve function to solve the equations n(x) = 0 and d(x)=0.
Here is my code:
syms x
f(x) = x^(3/5) * (4 – x)^(1/3);
df(x) = diff(f(x));
[n d] = numden(df(x));
nzeros = solve(n == 0);
dzeros = solve(d == 0);
%%%%%%% Kod rysujący jest poniżej %%%%%%%%
figure; hold on; grid on;
fplot(f(x),’LineWidth’,2);
fplot(df(x),’LineWidth’,2);
ylim([-6,6]);
legend(‘$f(x)$’,’$f”(x)$’,’Interpreter’,’latex’,’FontSize’,14);
Assign them to the "nzeros" and "dzeros" I can’t write lines 5 and lines 6 of the code correctly
Code error:
Variable n must be of data type symfun. It is currently of type sym. Check where the variable is assigned a value.
I tried replacing the code like this:
syms x
f(x) = x^(3/5) * (4 – x)^(1/3);
df(x) = diff(f(x));
[n d] = numden(df(x));
nzeros = solve(symfun(n,x) == 0);
dzeros = solve(symfun(d,x) == 0);
%%%%%%% Kod rysujący jest poniżej %%%%%%%%
figure; hold on; grid on;
fplot(f(x),’LineWidth’,2);
fplot(df(x),’LineWidth’,2);
ylim([-6,6]);
legend(‘$f(x)$’,’$f”(x)$’,’Interpreter’,’latex’,’FontSize’,14);
However, the same error message keeps popping up.
Can anyone help? the content of the task:
Follow these steps to obtain expressions for the critical values of f(x)=x^(3/5)*(4-x)^(1/3):
Define the symbolic function f(x) corresponding to the above formula.
Use the diff function to differentiate f(x) and define the symbolic function df(x).
Use the numden function to obtain symbolic expressions for the numerator and denominator of df(x) and store them in the variables n and d, respectively.
Use the solve function to solve the equations n(x)=0 and d(x)=0. Assign them to the nzeros and zeroros variables respectively.
I have a problem, for this task:
Use the solve function to solve the equations n(x) = 0 and d(x)=0.
Here is my code:
syms x
f(x) = x^(3/5) * (4 – x)^(1/3);
df(x) = diff(f(x));
[n d] = numden(df(x));
nzeros = solve(n == 0);
dzeros = solve(d == 0);
%%%%%%% Kod rysujący jest poniżej %%%%%%%%
figure; hold on; grid on;
fplot(f(x),’LineWidth’,2);
fplot(df(x),’LineWidth’,2);
ylim([-6,6]);
legend(‘$f(x)$’,’$f”(x)$’,’Interpreter’,’latex’,’FontSize’,14);
Assign them to the "nzeros" and "dzeros" I can’t write lines 5 and lines 6 of the code correctly
Code error:
Variable n must be of data type symfun. It is currently of type sym. Check where the variable is assigned a value.
I tried replacing the code like this:
syms x
f(x) = x^(3/5) * (4 – x)^(1/3);
df(x) = diff(f(x));
[n d] = numden(df(x));
nzeros = solve(symfun(n,x) == 0);
dzeros = solve(symfun(d,x) == 0);
%%%%%%% Kod rysujący jest poniżej %%%%%%%%
figure; hold on; grid on;
fplot(f(x),’LineWidth’,2);
fplot(df(x),’LineWidth’,2);
ylim([-6,6]);
legend(‘$f(x)$’,’$f”(x)$’,’Interpreter’,’latex’,’FontSize’,14);
However, the same error message keeps popping up.
Can anyone help? #matlab #symfun MATLAB Answers — New Questions