Plotting and Save Data for Multiple Variables
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Sindhu Karri
am 11 Nov. 2020
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 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!