フィルターのクリア

calculating and plotting non continuous function

2 ビュー (過去 30 日間)
Bart
Bart 2012 年 3 月 2 日
Hi,
I'm trying to calculate and plot the surface area of what I think is a 3d surface function. The problem that I have is that the function is the sum of "chucks" of a function. Here's the code:
>> t2 = ((a1*(trest - b1)^c1)+d1)*i^(i*((a2*trest^b2) + c2)) + ((a3*(trest-b3)^c3)+d3);
>> ton = 0:.1:60;
>> trest = 0:.1:60;
>> [X,Y] = meshgrid(ton,trest);
>> Ttot = 120;
>> syms x, t;
>> total = 0;
>> for i = 1:(Ttot/(ton+trest))
total = total + double(int(a*exp(b*t) + c*exp(d*t),t,t2,ton+t2));
end
surf(total,X,Y)
??? Error using ==> mrdivide
Matrix dimensions must agree.
Any ideas how I can get around this problem? The variables on which the for loop is dependent also determine the value of the surface area. The problem is that I'm counting up to a variable, and I don't really see a way around it. Was hoping Matlab would :) Any help is greatly appreciated!

採用された回答

Walter Roberson
Walter Roberson 2012 年 3 月 2 日
Try
Ttot ./ (ton+trest)

その他の回答 (2 件)

Jonathan Sullivan
Jonathan Sullivan 2012 年 3 月 2 日
Brat. Your code is illegible. Please use the "code" button when typing it so that it's easier to follow.
  2 件のコメント
Bart
Bart 2012 年 3 月 2 日
trying to asap :)
Bart
Bart 2012 年 3 月 2 日
done!

サインインしてコメントする。


Bart
Bart 2012 年 3 月 2 日
anybody? :D

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by