Can't sort this code
3 ビュー (過去 30 日間)
古いコメントを表示
The original question has been removed by the user.
4 件のコメント
Jan
2012 年 1 月 26 日
Please take the time to formulate a complete question. Currently it is not clear, what the program does, if it fails or not, if it creates the wanted results, or if not, what the dfferences between the results and your expectations are.
採用された回答
Dr. Seis
2012 年 1 月 26 日
You define fnj as MxN, but in your for loop you are assigning values to fnj(j,n) where:
j = 1 : N
and
n = 1 : M
I think you meant to do "j = 1 : M" and "n = 1 : N"
Also make the change suggested by proecsm, namely
Fn = sum(fnj,2)
2 件のコメント
Dr. Seis
2012 年 1 月 26 日
If you swap fnj(j,n) for fnj(n,j) - make sure you get both -, then you don't need to make the change to sum. Leave it as "Fn = sum(fnj);"
その他の回答 (2 件)
bym
2012 年 1 月 26 日
You do not have 2 lines on the graph: it goes from left to right & back again. After some noodling, I think you want to replace
Fn = sum(fnj);
%plot(AnRec,Fn)
pn = Fn*(M./(ar*N));
plot(xjRec,pn,'LineWidth',1.7)
with the following, which makes more sense (or at the very least presents more pleasing plots :) )
Fn = sum(fnj,2);
plot(AnRec,Fn)
figure
pn = Fn*(M./(ar*N));
plot(xjRec,pn,'LineWidth',1.7)
2 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!