How can I use meshgrid in a loop?

2 vues (au cours des 30 derniers jours)
Syed Ali Hassan
Syed Ali Hassan le 23 Avr 2014
Commenté : Syed Ali Hassan le 23 Avr 2014
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

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 23 Avr 2014
Use cell array
P{i}=
  3 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 23 Avr 2014
%function [Pn,Lightn]=init_ffa(n,range)
%your code
Pn{1}=P1n;
Pn{2}=P2n;
Pn{3}=Pn
Syed Ali Hassan
Syed Ali Hassan le 23 Avr 2014
%function [Pn,Lightn]=init_ffa(n,range)
%your code
Pn{1}=P1n;
Pn{2}=P2n;
Pn{3}=P3n;
that isn't work.

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by