if A=1:0.1:10 and B=1:4,T=exp(A/B) , is there anyway to plot a graph of T against A?
1 次查看(过去 30 天)
显示 更早的评论
if A=1:0.1:10 and B=1:4, T=exp(A/B) , since they are of matrices of different sizes, is there anyway to plot a graph of T against A such as using for loops?
0 个评论
回答(2 个)
Sean de Wolski
2013-10-29
编辑:Sean de Wolski
2013-10-29
Use bsxfun to do the division. Here is a small example:
A = 1:0.1:10;
B = 1:4;
T = exp(bsxfun(@rdivide,A,B'));
plot(A,T)
Note, four lines have been drawn, the plot it just scaled to the very large values so the rest appear lumped at the bottom.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!