what is wrong in my code trapezoidal rule
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Elisee Yanna
 il 18 Dic 2017
  
    
    
    
    
    Modificato: Christoph F.
      
 il 18 Dic 2017
            %Aufgabe5 teil a Trapezregel function[A]=trapzregel(a,b,N)
dt=((b-a)/N )% dt=h= (b-a) ist die Trapezbreite x=a:dt:b; % Schritte f=@(x){10*sin(x)./x}; %gegebene Funktion %a,b sind die Integrationsgrenzen %plot(fx,'r') % N ist die Zahl der Intervallen A=0; for(n=1:1:N)
%plot(fx,'r')
A=A+{dt/2}*{f(a)+f(a+dt)} a=a+dt;
end
Hallo i need some help for my Cod , i write it to learn how to use the trapezoidal rule, but i become a failled , and i don t know how to solve it. Can somebody help me ? Thank you. Elisé
|Undefined operator '+' for input arguments of type 'cell'.
Error in trapzregel (line 15) A=A+{dt/2}*{f(a)+f(a+dt)}|
0 Commenti
Risposta accettata
  Christoph F.
      
 il 18 Dic 2017
        
      Modificato: Christoph F.
      
 il 18 Dic 2017
  
      Curly brackets {} have a special meaning in MatLAB syntax (usually when you want to work with the cell datatype).
If you did not intend to work with cells or don't know what this means, use regular brackets () instead.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Develop Apps Using App Designer 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!

