How to create multiple graphs based on a variable that goes into a for-loop?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello Community,
I want to plot multiple graphs into one figure.
The multiple graphs are based on different geometry inputs, i.e. 4 graphs needed for 4 different ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/322900/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/322900/image.png)
The different geometry inputs are used in a loop for B:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/322903/image.png)
I can find the result for every single geometry input, which is fine:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/322906/image.png)
How can I create several graphs for several geometry inputs at the same time?
Thank you very much
채택된 답변
darova
2020년 6월 28일
Maybe you need only one more for loop
expansion = [1 2 3 4];
x = 0:10;
% data
for k = 1:length(expansion)
y = sin(x)*expansion(k);
line(x,y)
end
댓글 수: 3
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!