Function problem with integral

3 ビュー (過去 30 日間)
OldCar
OldCar 2016 年 5 月 11 日
回答済み: Star Strider 2016 年 5 月 11 日
I have written a function that doesn' work. When I type d=apertura(500,10,25); it says Attempted to access apertura(500,10,25); index out of bounds because size(apertura)=[1,1,1].
function [D]=apertura(T_int,phi1,phi2)
%calcolo dell'apertura sintetica A=25; %km B=50; %km n=2*pi/86164; phi1=deg2rad(phi1); phi2=deg2rad(phi2);
fun= @(t) (sqrt((n*A*cos(n*t+phi1)).^2+(n*2*A*(sin(n*t+phi1))).^2+(n*B^2*(cos(n*t+phi2)).^2)));
D=integral(fun,0,T_int);
end

採用された回答

Star Strider
Star Strider 2016 年 5 月 11 日
Have you defined a variable named ‘apertura’ earlier in your code?

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by