Plotting and Save Data for Multiple Variables
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I'm having problems to plot and save data for different variables. The variables in my code are lam, n1 , n2, and r1 where n1 or n2 are the index value and r1 is the period value. For a single value of n1, n2 and r1, I can easily get a graph. However, when I take the values from excelsheet for n1 and r1, I don't get multiplie graph. Please note that for a single value of n1 or r1, there is a range of value for lam. For every value of n1 and r1 from excelsheet, I would like to get graph and their corresponding wave values. Please help me to resolve the problem. I'm also attaching the code as well as excelsheet.
댓글 수: 0
답변 (1개)
Sindhu Karri
2020년 11월 11일
Hii Sohel,
1)By using “for” loop you can calculate the value of R and get graph of (Iam,R) for each value of n1,r1.
2)You can use “savefig” inside the “for” loop to save the graph of(Iam,R) for each value of n1,r1
3)You can refer the code attached below for better understanding
a=[12; 34; 56; 87]
iMax = size(a,1);
for iIdx = 1:iMax
l=0:0.2:2
myArray =l*iIdx;
plot(l,myArray)
title=strcat("result",int2str(iIdx))
savefig(title)
end
Refer to below links :
댓글 수: 0
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!