Plotting and Save Data for Multiple Variables

조회 수: 2 (최근 30일)
Sohel Rana
Sohel Rana 2020년 11월 2일
답변: Sindhu Karri 2020년 11월 11일
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.

답변 (1개)

Sindhu Karri
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 :

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by