How can I use meshgrid in a loop?

조회 수: 2 (최근 30일)
Syed Ali Hassan
Syed Ali Hassan 2014년 4월 23일
댓글: Syed Ali Hassan 2014년 4월 23일
P1=meshgrid(range(1):dP(1):range(2));
P2=meshgrid(range(3):dP(2):range(4));
P3=meshgrid(range(5):dP(3):range(6));
I want like that
tempn=2;
for i = 1:3
P(i)=meshgrid(range(tempn-1):dP(i):range(tempn));
tempn=tempn+2;
end

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 23일
Use cell array
P{i}=
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 23일
%function [Pn,Lightn]=init_ffa(n,range)
%your code
Pn{1}=P1n;
Pn{2}=P2n;
Pn{3}=Pn
Syed Ali Hassan
Syed Ali Hassan 2014년 4월 23일
%function [Pn,Lightn]=init_ffa(n,range)
%your code
Pn{1}=P1n;
Pn{2}=P2n;
Pn{3}=P3n;
that isn't work.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by