Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

how to write this function code

1 visualizzazione (ultimi 30 giorni)
marwan alamah
marwan alamah il 9 Giu 2020
Chiuso: MATLAB Answer Bot il 20 Ago 2021
y(2.5)=3*x.^5+2*x.^3+x.^2+7

Risposte (1)

David Hill
David Hill il 9 Giu 2020
y=@(x)3*x.^5+2*x.^3+7;
y(2.5);
  2 Commenti
marwan alamah
marwan alamah il 9 Giu 2020
what should i write after ;
if i pressed enter there is no answer only after deleting it
David Hill
David Hill il 9 Giu 2020
y contains the function. You can evaluate y at any points you want and store the values in a different variable or default ans.
x=y(2.5);%x will now contain the value of the function y and 2.5
z=y(1:10);%z will by an array containing the values of y at 1,2,3,...10
display(x);%will display but you can just look at the work space to find the values as well

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by