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!