How to include plot in a function?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi everyone, basically this is the coding function (https://uk.mathworks.com/matlabcentral/fileexchange/880-mutual-average-information) that I've used to calculate the Average Mutual Information (AMI) in order to find the time delay. I want to plot time lags against AMI. similar to this picture. The problem now is i don't know how to include plotting coding in my fuction. Hope you guys can teach me yaa. thanks in advance!
4 件のコメント
Tommy
2020 年 4 月 19 日
If you are inputting a scalar value for lag, you will get a scalar for v. You are then plotting a single point.
To see this point, use
%% PLOT
if lag > 1
t = 0:lag;
plot(lag,v,'o')
xlabel('Time Lag')
ylabel('AMI')
title('Average Mutual Information')
end
I suspect that you should be using a vector for lag.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!