How can I use meshgrid in a loop?

3 次查看(过去 30 天)
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 中查找有关 Line Plots 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by