how to define that function in matlab
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti

0 Commenti
Risposte (1)
DGM
il 25 Lug 2021
Modificato: DGM
il 25 Lug 2021
I could bark out the boilerplate response for low-effort copypasted homework questions, but I'm out of breath today. Let's settle for a compromise. Here's a conceptual example that is intentionally not exactly what you need, but can be rearranged with some minor effort.
f = @(x) (x.^2 + 2*x +2) ./ (exp(x) + x.^(1/2) .* cos(x)); % define function
out = f(1:15) % evaluate the function at some integer values
This example defines an anonymous function, which should be sufficient for the task, but there are other ways to define a function. Refer to the docs:
0 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!