Effacer les filtres
Effacer les filtres

Trapz method doesnt work

5 vues (au cours des 30 derniers jours)
Kamil Tkacz
Kamil Tkacz le 1 Fév 2015
Commenté : Star Strider le 1 Fév 2015
Hello i have problem with trapz method. I wrote a very easy code but i have an error with it. I would be very gratefull if someone find a reason of this madness.
clear all
clc
X =[1:10];
Y = X.^2;
a=trapz(X,Y);
disp(a)

Réponses (1)

Star Strider
Star Strider le 1 Fév 2015
You code runs for me without error.
In the Command Window, type:
which trapz -all
My guess is that the first line will be:
trapz is a variable.
In that situation, you will need to rename whatever your current ‘trapz’ variable is so the trapz function will work correctly.
  4 commentaires
Kamil Tkacz
Kamil Tkacz le 1 Fév 2015
Its works man!!! Thank u so much :)
Star Strider
Star Strider le 1 Fév 2015
My pleasure!
The most sincere expression of appreciation here on MATALB Answers is to Accept the Answer that most closely solves you problem.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by