İntegral with array boundaries Need help
3 ビュー (過去 30 日間)
古いコメントを表示
Hi Guys ,
I want to write a code which includes an array like x=[1 2 3;4 5 6] and
my function is
f=@(y) (y-x).^2
and
Q= integral ( f,0,x);
* *I couldn't be successful about it and I need help how can I take an integral over array boundries like this.* *
Thanks. One of members told me to try below command Qscalarx but it dint work for me. I tried it like below (scalar) ,
x=in(:,3:4);
Qscalarx = @(x)integral(@(w) kr*(in(:,3:4)-w)*(k*l*vi/(wr*ccons))*(((1+p*l)*vi/ccons).^(k-1))*2.71.^((-((1+p*l)*vi/ccons)).^k),0,x);
Q = @(x)arrayfun(Qscalarx,x);
Q(x);
But it didn't work. Am I missing smth ?
0 件のコメント
回答 (1 件)
Mike Hosea
2015 年 3 月 22 日
I've answered this question in a follow-up comment on the other question. It will work, but you have to debug your code. You were supposed to substitute x for in(:,3:4) in the integrand. Since p is a function of w, you'll need to use p(w) everywhere, and some of your multiplications will need to be changed from matrix multiplication * to element-wise array multiplication .*.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Pulsed Waveforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!